Why do I get "Expected ;" error and "Variable not declared in scope" error?
<p>i have following code</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;set&gt;
#include &lt;string&gt;
using namespace std;

template&lt;class  Container&gt;
void print(const Container &amp;c)
{

   Container::const_iterator itr;
   for (itr=c.begin();itr!=c.end();itr++){
      cout&lt;&lt;*itr&lt;&lt; '\n';
}

}

int main(){

   set&lt;string,greater&lt;string&gt;&gt;s;
   s.insert("georgia");
   s.insert("saqartvelo");
   print(s);
   return 0;

}
</code></pre>

<p>but errors are</p>

<pre><code>reverse.cpp: In function ‘void print(const Container&amp;)’:
reverse.cpp:9: error: expected ‘;’ before ‘itr’
reverse.cpp:10: error: ‘itr’ was not declared in this scope
reverse.cpp: In function ‘int main()’:
reverse.cpp:17: error: ‘s’ was not declared in this scope
reverse.cpp:17: error: ‘&gt;&gt;’ should be ‘&gt; &gt;’ within a nested template argument list
</code></pre>

<p>What might cause this and how do I solve it?</p>
