fileName is a variable, of type pointer to char. You could use an array, too:
char fileName[] = "Things.txt";
Pointers and array are often, but not always, interchangeable.
and what are Strings used for then?
Fragmenting memory. On larger Arduinos (memory-wise), they can dynamically grow, and the methods for dealing with the character data are part of the class. On the smaller Arduinos, they are often a disaster.
My mistakes. I appreciate what you have done very much, and will give you as much code as needed.
Here is the function and the relevant variables:
void FinishSaveWord()
{
if(!isItaList)//this works, but is supposed to be replace by the following if() statement
{
wordList = SD.open("wordlist.txt", FILE_WRITE);
}
/*
if(!isItaList) //I don't know what I'm doing at this point:
{
tempWord=wordArray[wordSelector];
//wordSelector is a integer no smaller or bigger than wordArray[] (0-49)
char buffer[30];
sprintf(, "%s.txt", tempword);
//wordList.write(buffer);
wordList = SD.open(buffer, FILE_WRITE);
}
*/
//everything below this line works
if(wordList)
{
wordList.write(typedWord);
wordList.close();
}
else
{
lcd.setCursor(0,3);
lcd.print("Error opening file");
}
}
File wordList;
char *wordArray[50]; //storage for 50 words that is to become file names
char *tempWord; //storage for 1 selected word, that will have ".txt" added to it, to make it a filename.
error:
CC10.ino: In function 'void FinishSaveWord()':
CC10:392: error: expected primary-expression before ',' token
expected primary-expression before ',' token