I'm trying to parse an html tag in an array assume called "buf". buf has the contents of an html file I have read from a server. Now, when I use strstr() to find a string or tag in there I get segmentation as well. I thought this example will be fine but it is not.
Can you please tell me what is the best approach here?
Any help is appreciated.
htmlcontent = buf;
char* needle = "<TITLE>";
char* heystack = buf;
printf(">>>The first character found: %c", strstr(heystack, needle));