Sequential file naming on SD card

I'm struggling here a bit. I want to write a fresh file each time the SD card is inserted. e.g. data0.csv data1.csv data2.csv

so I thought that something like count++ fileName="data" & count & ".csv" could work. but this approach looks to be rubbish. What is the correct approach? Yours Simon M.

so I thought that something like count++ fileName="data" & count & ".csv" could work. but this approach looks to be rubbish. What is the correct approach?

The correct approach is to use code that stands a chance of working. No matter what type fileName is, the & operator is not the correct one to use.

Of course, you should be able to see from this comment that we don't know what type fileName is, so any help in getting a variable encoded in the variable is going to be vague.

If you'd read the sticky, you'd know that the requirement for posting here is to post your code (properly).

This thread has info about that: http://arduino.cc/forum/index.php/topic,144336.0.html

Pete