Filename in

I tried to set a filename with date (montday,month,year) . The compile reject the variable name in

Monitor_Chaudiere.cpp: In function ‘void ecriture_Log()’:
Monitor_Chaudiere.cpp:338:51: error: no matching function for call to ‘SDClass::open(String&, int)’
/usr/share/arduino/libraries/SD/SD.h:74:8: note: candidate is: File SDClass::open(const char*, uint8_t)
Is there a way to do that?

myFile =, FILE_WRITE);

dsname built as a string:
dsname = (" " ) ;
dsname += monthDay ;
dsname += “" ;
dsname += month ;
dsname += "
” ;
dsname += year ;

The compile reject the variable name in

Yes, it did, because you used a String. So, don't do that. Use a string (NULL terminated array of char) and sprintf(), instead.

thks it works with that : sprintf(dsname,"%i-%i-%i",monthDay,month,year) ; but how to append .txt.


but how to append .txt.

sprintf(dsname,"%i-%i-%i.txt",monthDay,month,year) ;

all is ok, thanks. Sorry I am very new with Arduino and don't really difference with string and char. Dominique