title: Getting error Expected unqualified-id before '{' token c++
body: <p>I am getting this error on this program. I have no idea where the issue is. I am trying for a simple program but no luck. Check my program for the issue. Thanks   </p>
  
  <pre><code>#include&lt;iostream&gt;
  using namespace std;
      void computeUserLevel (char *);
      main()
      {
          char Y[4];
          for(i=0; i&lt;=4; i++)
          {
              cout&lt;&lt;"arrays and pointers are same:";
               cin&gt;&gt; Y[0];
               cout&lt;&lt;"switch is a loop: ";
               cin&gt;&gt; Y[1];
               cout&lt;&lt;"pointers store memory addresses  : ";
               cin&gt;&gt;Y[2];
          }
          computeUserLevel(Y);
          return 0;
  
      }
      void computeUserLevel (char *ptr)
      {
          if (*ptr == 'f' &amp;&amp; *(ptr+1) == 'f' &amp;&amp; *(ptr+2) == 't')
          {
              cout&lt;&lt;"your level is Advance";
          }
          else if (*ptr == 't' &amp;&amp; *(ptr+1) == 'f' &amp;&amp; *(ptr+2) == 't')
          {
              cout&lt;&lt;"your level is Intermediate";
          }
          else
              cout&lt;&lt; "your level is Beginner";
      }
  </code></pre>