vote up 0 vote down
star

shell programming을 하는 와중에 Token 분석을 해서 각각의 Token을 문자 배열로 넣어줘야 합니다.

include

include

include

include

include

int main() { char* string; //gets로 입력 받는 문자열 char* temper; // 토큰을 임시로 받을 포인터

gets(string); temper = strtok(string, " "); return 0; }

그런데 막상 실행해보면 segment error가 납니다.

왜 그런 것인지 잘 이해를 못하겠습니다.

char* temper[1]로 선언하고 넣으면 잘 되는데 말이죠.

flag

Your Answer

Get an OpenID
or

Browse other questions tagged or ask your own question.