Jump to content
  • Advertisement
Sign in to follow this  
Inuyashakagome16

o boy i have a problem.

This topic is 4812 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

ok this is stupid but, i just got DEV-C++ the compiler adn IDE program. (awesome) ok now i started reading a tutoral and it said : #include <stdio.h> int main() { printf( "I am alive! Beware.\n" ); getchar(); return 0; } ok well i put it in the compiler and it said this: 1:9 C:\Documents and Settings\FAMILY\My Documents\stdio.c #include expects "FILENAME" or <FILENAME> 2 C:\Documents and Settings\FAMILY\My Documents\stdio.c syntax error before '<' token 7 C:\Documents and Settings\FAMILY\My Documents\stdio.c [Warning] data definition has no type or storage class 8 C:\Documents and Settings\FAMILY\My Documents\stdio.c syntax error before "return" WHY does it say that? Help me plz. :-(

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
I don't know if this will work, but try putting deleting the newline between #include and , so
#include

becomes
#include

Share this post


Link to post
Share on other sites
I have an old-ish book on C, and it doesn't have the "int" before the "main". Try removing the "int"?

EDIT: Doh. Look at the posts above mine. :P

Share this post


Link to post
Share on other sites
it should be:
#include <stdio.h>

note that stdio.h is the deprecated c header file and it should really be:
#include <cstdio>

Share this post


Link to post
Share on other sites
I am not sure if DEV-C++ ignores whitespace, so try the following:


#include <stdio.h>

int main()
{
printf( "I am alive! Beware.\n" );
getchar();
return 0;
}



[EDIT]
Wow! I agree, you guys are fast! :-)

Share this post


Link to post
Share on other sites
Quote:
Original post by linkofazeroth
I have an old-ish book on C, and it doesn't have the "int" before the "main". Try removing the "int"?

EDIT: Doh. Look at the posts above mine. :P


standard c states that main should return int.

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!