Answers for "split string at space C"

C
-2

split string at space C

char* string;
char* first;
char* second;

for (int i=0;i<=strlen(string);i++) {
	if (string[i] == ' ') {
		string[i] = '\0';
		first = string;
		second = string+i+1;
		break;
	}
}
Posted by: Guest on February-22-2021

Code answers related to "C"

Browse Popular Code Answers by Language