char* cut(char* pStr, int col, char* delim=",") { // not a real-life code, all good assumptions here: int n = 0; while(*pStr++){ if(*pStr==*delim){ if(++n == col){ return until_next_one(++pStr, delim); } } } }