2016-07-27 2 views
0

내 Codeblocks ide에서이 기본 코드에 대해 "오류 1d가 1 종료 상태를 반환했습니다"라는 이유를 알고 싶었습니다.오류를 해결하는 방법 1d가 1 종료 상태를 반환했습니다.

#include<stdio.h> 
main() 
{ 
    printf("This is the first statement \n"); 
    printf("This is the second statement \n"); 
    printf("This is the third statement \n"); 
    printf("This is the third statement \n"); 
    goto end; 
    printf("This is the fourth statement \n"); 
    end: printf("This is th fifth statement \n"); 
} 
+1

아마'main()'이 의미있는 것을 반환하지 않기 때문일 것입니다. 그리고 프로세스 종료 코드는 정의되지 않습니다. 'main()'을 적절한 방법으로 선언하고'return 0;'문장을 끝에 쓴다. – Sergio

+2

** return 0 **이 필요하지 않습니다. C99는 암시 적이기 때문에. – Michi

+1

'main()'을'int main (void)'으로 변경해보십시오. – 4386427

답변

0

반환 값 main을 지정하지 않았습니다. 따라서 기본값은 int입니다. 하지만 return 문을 제공하지 않았습니다.

관련 문제