CnUnix

[알림판목록 I] [알림판목록 II] [글목록][이 전][다 음]
[ CnUnix ] in KIDS
글 쓴 이(By): guest (guest) <203.236.3.225>
날 짜 (Date): 2002년 7월 26일 금요일 오후 03시 31분 49초
제 목(Title): [q] gcc에서 undeclared  error...


#include <stdio.h>

main()
{
        int i = 5;

        for (j = 3; i < 10; i++, j++) {
                printf("i--> %d \t j--> %d\n", i, j);
        }
}

와 같은 source에서 아래와 같은 에러가 나옵니다.
compiler는 g++을 사용했습니다.

a.cpp:7: `j' undeclared (first use this function)
a.cpp:7: (Each undeclared identifier is reported only once for each 
function it 
   appears in.)

원래 C++에서는 위와 같은 j라는 변수 사용이 가능한걸로 알았는데...

왜그럴까요? 

[알림판목록 I] [알림판목록 II] [글 목록][이 전][다 음]
키 즈 는 열 린 사 람 들 의 모 임 입 니 다.