@CTRLS wrote:
i really need some help right now….my computer isnt running the program that i programmed…as of right now im reading the Teach Yourself C in 21 days and i wrote my first source code it looks something like this
#include
main()
{
printf(“Hello, World!”/n);
return 0;
}
and i complie it and try to build and run it but it does nothing!!!!
can someone help me out
// Note the space between include and the header.
#include
main()
{
printf(“Hello, World! n”);
return 0;
}
It’s been ages since I wrote C code, and if anything is wrong with that example, it would probably be the declaration of main() (In some languages you have to use “void” with main as well, but I’m noob so I forgot lol.)
Use Code::Blocks to compile the code as well, if you’re on Windows. If you’re on Linux, use “gcc”. (e.g.: gcc sourcecode.c -o outputfilename )
After you’ve compiled the executable, if you’re on linux, you may have to make it executable like this: chmod +x outputfilename