Johannes Bauer said:
"main" has a return parameter which is an int. Always.
That's incorrect.
Here's what the standard says about the main function for a conforming
hosted implementation:
It shall be defined with a return type of int and with no parameters:
int main(void) { /* ... */ }
or with two parameters (referred to here as argc and argv,
though any names may be used, as they are local to the function
in which they are declared):
int main(int argc, char *argv[]) { /* ... */ }
or equivalent; or in some other implementation-defined manner.
The phrase "implementation-defined" means that the implementation must
document it.
So if your compiler's documentation says you can define
void main(void) { /* ... */ }
then you can do that, and your program is conforming *for that
implementation*. And if it doesn't, then your program violates a
"shall" that appears outside a constraint, which means that its
behavior is undefined -- which means that it *can* behave just as
if you had defined it with a return type of int.
But for a hosted implementation, there's very little *reason* to define
main as a void function. And if you're writing a book about C,
suggesting that "void main" is valid for hosted implementations without
explaining how and why it might not be valid is malpractice.
Also quoting the standard:
In a freestanding environment (in which C program execution
may take place without any benefit of an operating system),
the name and type of the function called at program startup
are implementation-defined.
Depending on the choices made by the authors of the implementation,
the entry point might be "void main(void)", or it might be "double
foobar(double complex*)". "int main(void)" might even be invalid
in such an environment.
So because most embedded systems are programmed in C you conclude that
most C programms are for embedded systems? Something is seriously wrong
with your logic.
You're assuming, among other things, that his conclusion follows only
from those other statements. And he didn't say that *most* C programs
are for embedded systems, only that "you are actually quite likely to be
working on embedded systems if you are programming in C" ("quite likely"
needn't imply more than 50%).
I suspect, without proof, that his conclusion is correct. (I work on
embedded systems myself, but they're embedded systems with an OS.)
In any case, I think that most *introductory* C tutorials are likely to
deal with hosted implementations such as Linux, MacOS, or Windows.