So I have this task: I have a source file of, for example news website, in which there are meta tags like <meta name="author" content="Go Outside">
. And, as you understand, that source file contains a lot of information. My task is to find that meta author tag and print out to the screen content of that meta tag, now it would be "Go Outside". I have no idea how to even start doing this.
I had one idea to scan like 18 chars, and check if that is required meta tag, but that doesn't work as I thought:
while(feof(src_file) == 0){
char key[18];
int i = 0;
while (i < 18 && (feof(src_file) == 0)){
key[i] = fgetc(src_file);
printf("%c", key[i]);
i++;
}
printf("\n%s", key);
}
The problem is that it prints out rubbish at this line.
Your help would be appreciated since I have been working and studying for 10 hours straight, you might be able to save me from going mad. Thanks.