Question: For example, the string const char *bb="abcdef;dsfads";
how to intercept the string before the ; number, abcdef forum link: http://topic.csdn.net/u/20100108/16/6eee2c27-2fad-4212 -a787-3ab68bf124d7.html?93233
nice answer
char *nn="abcdef"
how to intercept the string before the ; number, abcdef forum link: http://topic.csdn.net/u/20100108/16/6eee2c27-2fad-4212 -a787-3ab68bf124d7.html?93233
nice answer
char *nn="abcdef"
const
char*bb="abcdef;dsfads"; int iLen =0; char* pIterator = bb; while(1) { if(*pIerator ==';') { break; } ++iLen; } char*pSubStr =newchar[iLen+1]; pSubStr[iLen] =0; memcpy(pSubStr,bb,iLen);