not sure if this only works for windows seeing as it's a system call, but system("PAUSE"); waits for any key to continue,.. try this:
Code:
#include <stdio.h>
/* this is a comment: if you use "int " before the name of a function,
you tell the compiler that this function will return an integer value.
That's why you need the "return 0;" at the end in order for it to
compile. */
int main()
{
printf("This is my first program");
system("PAUSE");
return 0;
}
Code:
#include <stdio.h>
/* if you write "void " before the program name you tell the compiler
that the program won't return a value. Which means you can skip
the "return 0;". Some people here claim that this way of doing it is
unclean though. Either way, you HAVE to write something before
the program name in order for it to compile... */
void main()
{
printf("This is my first program");
system("PAUSE");
}