Quantcast
Viewing all articles
Browse latest Browse all 42

Comment by Lundin on Function to skip characters

Many aren't aware of the standard strcspn function. It returns the length of a string until the point where one out of several characters has been found. size_t i = strcspn(str, " \t\r\n"); /* whatever characters you like to stop at */ char* next = &str[i+1]; Seems it would be useful for your specific scenario.

Viewing all articles
Browse latest Browse all 42

Trending Articles