title: Error converting a char[] string to uppercase
body: <p>This code is giving me an error that <code>sptr</code> was not declared in the <code>while</code> loop.</p>
  <pre><code>#include&lt;iostream&gt;
  
  #include&lt;ctype.h&gt;
  
  #include&lt;stdlib.h&gt;
  
  using namespace std;
  
  void convertToUppercase (char *s);
  
  main()
  
  {
      {
      
  char s [40]=&quot;Welcome to gbk gang&quot;;
  
  cout&lt;&lt;&quot;Before converting The string is! &quot;&lt;&lt;s&lt;&lt;endl;
  
  void *convertToUppercase(s) ;
  
  
  cout&lt;&lt;&quot;After converting The string is! &quot;&lt;&lt;s&lt;&lt;endl;}
  
  
  
  void convertToUppercase(char *sptr)
  
  
      while(*sptr!='\0')
  
      {
          if(islower(*sptr))
      }
  
  return 0 ;
  }
  </code></pre>