hi, I'm new to C and Pelles C. I am using the book "The C Programming Language Second Edition" by Brian W. Kernighan & Dennis M. Ritchie. the book did not specify a compiler to use, so by recommendation I downloaded Pelles C. however, I am having some problems.
question #1: why all the extra code?
according to The C Programming Language, the following code SHOULD be sufficient:
#include <stdio.h>
main()
{
printf("Hello, world\n");
}
but it seems that Pelles C requires that I write it like this:
#include <stdio.h>
int main(void)
{
printf("Hello, world\n");
return 0;
}
why does it require more code than my book says it does?
question #2: why won't it run?
I am quite certain that I compiled it as a Console program, but whenever I try to run the program in the command prompt I get messages like this:
"Windows cannot open this file. to open this file, windows needs to know what program you want to use to open it. Windows can go online to look it up automatically, or you can manually select from a list of programs that are installed on your computer."
why won't it run in the command prompt?