I figured this might as well be in its own thread.
I'm surprised how I can't find a solution to this problem on the internet. It must be a very common error:
Here is the code in question:
I always get an error involving "constant char".Code:#define IBS 150 ... int main() { /* Get Filename from user */ char szbuf[IBS]; puts ("Enter file to be opened: "); fgets(szbuf, IBS, stdin ); char filename[ strlen(szbuf)]; strcpy(filename, szbuf); /* Open File */ FILE * fp = fopen(filename, "r"); ...
I'm doing something wrong in what I am passing to the "fopen()" function. What does it want? I thought it was a string?
Thanks in advance,
Clint



LinkBack URL
About LinkBacks



