title: Writing to file Visual C++
body: <p>I write to a text file like so: </p>
  
  <pre><code>void writeText(char* desc){
      FILE * pFile;
      pFile = fopen ("CycleTestInfo.txt","a+");
      fputs (desc,pFile);
      fclose(pFile);
  }
  </code></pre>
  
  <p>I embed this in a for loop and I want to write to the file the loop that I am on:</p>
  
  <pre><code>for(int i=0; i&lt;cycles; i++){
      char* cycle="--NEW CYCLE "+(char)i+"---\r\n";
      writeText(cycle);
  }
  </code></pre>
  
  <p>However, I get <code>error C2110: '+' : cannot add two pointers</code> at the line where I declare <code>cycle</code>. How can I declare the the variable so that I can include the cycle number, <code>i</code> and also add a string to both sides?</p>
  
  <p>Thanks for the help!</p>