: char filename[20]={0,};
: ifstream pro_file(filename);
:
: if( pro_file.fail() ) <=에러
: cout<<"Error... Can't open the file"<<filename<<endl;
: 이렇게 작성을 했는데
: g++로 컴파일을 하니
: userprocess.cpp:47: `pro_file' undeclared (first use this function)
: userprocess.cpp:47: (Each undeclared identifier is reported only once
: for each function it appears in.)
: userprocess.cpp:48: `filename' undeclared (first use this function)
: 이런 에러가 나네요.
: 선언이 되지 않았다고 하는데 분명히 선언은 되어 있고...
: 도대체 왜이런지 모르겠습니다.
: 답변 부탁드립니다.
: 아 그리고 g++용 통합에디터 좋은것 추천 부탁드립니다.
: 디버거 라도...
이상하네여!
전 잘되는데 ^^;
ifstream클래스를 사용하실려면 fstream.h를 include해야합니다.
파일관련 클래스는 fstream.h를 필요 포함해야돼죠
그리고 filename이 null이라 에러메시지가 찍힌것은 당연하겟네여
g++용 통합에디터라기보다는 범용 IDE로 kdevelop나 kdestudio정도 추천합니다. 윈도우의 비주얼
C++ IDE 저리가라 할 정도로 쓸만합니다.