Wpis z mikrobloga

@lguodwznkoi_e: nie, jeśli w main() nie ma return to jest implicitly return 0:

If the return type of the main function is a type compatible with int,

a return from the initial call to the main function is equivalent to

calling the exit function with the value returned by the main function

as its argument; reaching the } that terminates the main function

returns a value of 0.
a tak poza tym to jakie ma to inne znaczenie?


@lguodwznkoi_e: nie rozumiem, jakie inne znaczenie? W skrócie, pod main() nie musi być explicit return - jeśli nie ma to jest implicit return 0. Ale jeśli jednak pisze się explicit return to lepiej jest użyć EXIT_SUCCESS bo nie na każdym systemie 0 to failure a non-0 to success choć na większości tak jest.