title: How to change a buffer string to uppercase within a program?
body: <p>I have a problem in C program. I have already a string in buffer and want to change the string to upper case and then write to the socket or take it to standard out.Please help me in below code.</p>
  
  <pre><code>char input[] = buffer;
  int  alpha_count = 0;
  for (int i = 0, x = strlen(input); i &lt; x; i++) {
    if (isalpha(input[i])) {
      if (alpha_count++ % 2 == 0 ) 
        input [i] = toupper(input[i]);
    }   
  }   
  printf("%s\n", input);
  </code></pre>