2013-06-04 2 views

답변

2

사용 strtok :이 도움이됩니다

/* strtok example */ 
#include <stdio.h> 
#include <string.h> 

int main() 
{ 
    char str[] ="- This, a sample string."; 
    char * pch; 
    printf ("Splitting string \"%s\" into tokens:\n",str); 
    pch = strtok (str," ,.-"); 
    while (pch != NULL) 
    { 
    printf ("%s\n",pch); 
    pch = strtok (NULL, " ,.-"); 
    } 
    return 0; 
} 

Output: 

Splitting string "- This, a sample string." into tokens: 
This 
a 
sample 
string 
+0

백 슬래시와 앞 슬래시로 작동하지 않습니다 ... –

+0

http://help.google.com/support/library/h21280bw(v=vs.80).aspx – CloudyMarble

0
string str = "Sanju\bala"; 
string[] splittedString = str.Split('\'); 

희망. :) :)

+0

자사의 VC가 아니야 ... 어떻게 헤더 헤더 파일을 추가 할 수 있습니까? –

+0

U 코드를 게시 할 수 있습니까? 어디에서 구현하고 싶습니까? – mailmehere

관련 문제