반응형

In C90, main() must have an explicit return statement at the end to avoid undefined behaviour. In C99 and newer, you may omit the return statement from main(). If you do, and main() finished, there is an implicit return 0.

 

C90에선 main() 함수에서 무조건 반환 타입을 정의 해야했지만,

C99부터 묵시적으로 return 0 를 수행하기 때문에 생략가능해졌다.

 

참고 : https://stackoverflow.com/questions/204476/what-should-main-return-in-c-and-c

반응형

+ Recent posts