title: convert String to type const char* using Arduino
body: <p>I am using the Arduino library.  I would like to log some data from a sensor, date-time stamp it and write it to a SD card.  </p>
  
  <p>To build the text file name I have tried </p>
  
  <pre><code>    String dataFileName = String(String(sedClock.getTime().year(),DEC) + 
                           String(sedClock.getTime().month(),DEC) + 
                           String(sedClock.getTime().day(),DEC) + 
                           String(sedClock.getTime().hour(),DEC) + 
                           String(sedClock.getTime().minute(),DEC) + 
                           String(sedClock.getTime().second(),DEC) + '_log.txt');
  </code></pre>
  
  <p>I would then like to log to that file using </p>
  
  <pre><code>      pinMode(SD_PIN,OUTPUT);
        dataFile = SD.open(dataFileName,FILE_WRITE);
  </code></pre>
  
  <p>But I get </p>
  
  <pre><code>    no matching function call to SDClass::open(String&amp;, int) 
      candidates are: File SDClass::open(const char*,uint_8)
  </code></pre>
  
  <p>But it seems that Arduino string doesn't have the equivalent of </p>
  
  <pre><code>    (const char *) dataFileName.c_str()
  </code></pre>
  
  <p>So I can't figure out how to do the correct conversion</p>
  
  <p>Any help would be greatly appreciated.</p>