title: (*var)[n] what does it mean in c++
body: <p>What does (*var)[n] mean in C++? In this code I know that it refers to getting the captured string from regex matches of group n, but I don't understand why this doesn't work: </p>
  
  <pre><code>*var[n] //edit: oh duh, that would be a multiplication
  </code></pre>
  
  <p>what's up with the parenthesis? reminds me of casting, all 3 gives the same results:</p>
  
  <pre><code>(char*)filename[0]
  const_cast&lt;char*&gt;(filename.c_str())
  &amp;filename[0]
  </code></pre>
  
  <p>but (char*) and (*it) have the asterisk in different places.</p>
  
  <pre><code>    regex expr("[_-]?([a-gA-G]#?(?:-2|-1|[0-8]))");
      int found = 0;
      for (sregex_iterator it(tagstruct.name.begin(), tagstruct.name.end(), expr), itEnd; it != itEnd; ++it) {
          if ((*it)[1] != "") {
              notename = (*it)[1];
              if (++found &gt;= search_count) {
                  f = NoteNameToFreq(notename);
                  break;
              }
          }
      }
  </code></pre>