Sign in to follow this  

Can any one help me?

This topic is 4586 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I ran into a problem compiling. this is the program, it is a demo: #include <stdio.h> int main () { char c; FILE * pFile; pFile = fopen ("myfile.txt","w+t"); if (pFile!=NULL) { fputs ("Welcom to Cp \"ZUF\"",pFile); { do { c = fgetc (pFile); } while (c != EOF); fclose (pFile); } printf ("File contains %d$.\n",c); return 0; } The error is: [Error]C:\progra~1\c-free~1.5\temp\untitled1.cpp:19:prase error at end of input line 18 is the last line I have had 20 and instead of ...:19:... it was ...:21:... I cannot find the error!!!!!!

Share this post


Link to post
Share on other sites
As mumpo has said:


#include <stdio.h>
int main()
{
char c;
FILE * pFile;
pFile = fopen ("myfile.txt","w+t");
if (pFile!=NULL)
{
fputs ("Welcom to Cp \"ZUF\"",pFile);
// {
do
{
c = fgetc (pFile);
}
while (c != EOF);
fclose (pFile);
}
printf ("File contains %d$.\n",c);
return 0;
}





You can use the You can use the [source] [/source] tags to format your code so it looks like that as well [wink]

[edit]You might also want to increase your tab indent as well to help catch things like this as well. I think I have mine set on 4. I looked at the formating on your OP and it looks kinda small. Just a suggestion though.

Share this post


Link to post
Share on other sites
Sign in to follow this