Hey how do I make so this would save myfile as a text file?
pFile = fopen (("%s",filename), "w");
I tried to add .txt after %s but that doesn't help.
Let me guess: you are a Pythonian, right?
In C, ("%s",filename)
is a comma expression; it evaluates to whatever is mentioned last, that is to filename
. Now, if you need a "myfile.txt" file, why don't you just spell it out explicitly:
char filename[256] = "myfile.txt";