title: reference to array is ambiguous error when using memset function
body: <p>I didn't understand why i take this "strange" error. I read similar questions but it didn't answer my questions. If i define the array inside main function rather than global scope, there is no error. But assume that i have to define this array in global scope. Why do i take this error?
  Here is the code  : </p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;cstring&gt;
  
  using namespace std;
  
  int right[1005];
  int main()
  {
      memset(right,0,sizeof(right));
  return 0;
  }
  </code></pre>
  
  <p>Here is the error : </p>
  
  <pre><code>memset2.cpp: In function ‘int main()’:
  memset2.cpp:9:9: error: reference to ‘right’ is ambiguous
    memset(right,0,sizeof(right));
       ^
  memset2.cpp:6:5: note: candidates are: int right [1005]
   int right[1005];
       ^
  In file included from /usr/include/c++/4.8/ios:42:0,
               from /usr/include/c++/4.8/ostream:38,
               from /usr/include/c++/4.8/iostream:39,
               from memset2.cpp:1:
  /usr/include/c++/4.8/bits/ios_base.h:924:3: note:                 std::ios_base&amp; std::right(std::ios_base&amp;)
     right(ios_base&amp; __base)
     ^
  memset2.cpp:9:24: error: reference to ‘right’ is ambiguous
    memset(right,0,sizeof(right));
                      ^
  memset2.cpp:6:5: note: candidates are: int right [1005]
   int right[1005];
       ^
  In file included from /usr/include/c++/4.8/ios:42:0,
               from /usr/include/c++/4.8/ostream:38,
               from /usr/include/c++/4.8/iostream:39,
               from memset2.cpp:1:
  /usr/include/c++/4.8/bits/ios_base.h:924:3: note:                 std::ios_base&amp; std::right(std::ios_base&amp;)
     right(ios_base&amp; __base)
     ^
  </code></pre>