[Solved] C- Reading specific strings with quotes from a file
[ad_1] This should do the trick: #include <stdio.h> #include <string.h> int extract_line (char* line, char* buffer, char* ctag) { char line_buffer[255] = {0}; char* tagStart; char* tagEnd; if( strlen(line) < (sizeof(line_buffer)/sizeof(char)) ) { strcpy(line_buffer,line); } else { printf(“Line size is too big.\n”); return 1; } tagStart = strstr(line_buffer,ctag); if(tagStart != NULL) { tagEnd = strstr(tagStart+1,ctag); … Read more