Substr C Example


Example 1: c substring

//where we want the word "test" and we know its position in the string char *buff = "this is a test string"; printf("%.*s", 4, buff + 10);

Example 2: c substring

char subbuff[5]; memcpy( subbuff, &buff[10], 4 ); subbuff[4] = '\0';

Comments

Popular posts from this blog

Converting A String To Int In Groovy

"Cannot Create Cache Directory /home//.composer/cache/repo/https---packagist.org/, Or Directory Is Not Writable. Proceeding Without Cache"

Android How Can I Convert A String To A Editable