I thought a lot about the most honest way of minimally expressing the main function in C (yes, this is trivial and usually not interesting, but I'm interested).
For a long time, to this day, I prefer to define the main as follows:
int main(int argc, char **argv)
{
return 0;
}
My problem is that I usually never use these arguments, so it makes the arguments explicit, although I don't care about them in the code to write them out.
So I started to do
int main()
{
return 0;
}
This is honest, since it does not explicitly state that the function has no arguments, as many do in the definition int main(void){}, and I am satisfied with this.
, main main , "" , , .
int main(...)
{
return 0;
}
- ...? ... (, , ,...). .
, (... , ), - . , C.
: