How to extract a substring from a string in C?
I tried using strncmp but it only works if I give it a specific number of bytes I want to extract. char line[256] = This "is" an example. //I want to extract "is" char line[256] = This is "also" an example. // I want to extract "also" char line[256] = This is the final "example". // I want to extract "example" char substring[256] How would I extract all the elements in between the ""? and put it in the variable substring? Floris Note: I edited this answer after I realized that as written the code would cause a problem as strtok doesn't like to operate on const char* variables. This was more an