title: How to use char* with SD library with Arduino?
body: <p>I am writing a data logger and would like to keep the files limited to a specific number of entries. I am trying to write this bit of code in the setup, so that when the Arduino powers on, it will write to a new file just to keep things simple. However, when I try to open the file I can't, although I am not sure why. Can anyone offer any explanation?  </p>
  
  <pre><code>char *fileName; //global name 
  File logFile; //global file 
  //everything else is in setup() 
  char * topPart = "/Data/Data"; //first part of every file 
  char * lowerPart = ".txt"; // jus the extention 
  char * itter; //used to hold the char of i later 
  fileName = "/Data/Data.txt"; //start with the first file possible.
  for(int i=0; i&lt;=100;i++) {
    if(!SD.exists(fileName)) {
      Serial.print("opening file: ");
      Serial.print(fileName);
      logFile = SD.open(fileName, FILE_WRITE);
      if(logFile) {
        logFile.println("I made it");
        Serial.println("in the file");
      }
      if(!logFile) {
        Serial.println("somthing bad");
      }
      break;
    } else {
      itter = (char *)(i+48);
      strcpy(fileName,topPart);
      strcpy(fileName,itter);
      strcpy(fileName,lowerPart);
      Serial.println(i);
    }
  }
  </code></pre>