<pre style="font-face:monospace">
#include <stdio.h>
#include <string.h>
int main(void)
{
char e[] = "2+3+4+5";
int res = 0;
char *tkn = strtok( e, "+" );
do
{
res += atoi( tkn );
} while( tkn = strtok( NULL, "+" ) );
printf( "result=%d\n", res );
return 0;
}
</pre>
댓글단거 방금 봤음.ㅇㅇ</pre>
아,, 왜이렇게 자꾸 깨지냐
http://forum.falinux.com/zbxe/?document_srl=408126&mid=C_LIB&sort_index=readed_count&order_type=desc
근데 문자열 자르는건 strtok 검색만 해도 나오는거라 이게 도움이 될지 모르겠다
부왘 감사 ㅋㅋㅋ 님 천재 인듯
프겔은 너무나도 훈훈 하다. 프겔 만세!
atoi는 안되네요?
해더 문제 구나 잘됨
ㄳ요 참고 하도록 할께요