I have a value in character pointer variable and the value is changed dynamically.
for e.g
one case: char *ptr = sometext || abc.txt; second case: char *ptr = abc.txt || sometext; I need only file name in another variable. str = abc.txt
currently I am using the code:
CString str; char* lpszToToken = stLine.GetBuffer(stLine.GetLength()); char* lpszToken = strtok(lpszToToken, "|"); while(lpszToken != NULL) { lpszToken = strtok(NULL, "|"); str = lpszToken; } but it working in only first case: I need a genric code to run in both case Any idea? Thanks,