I'm attempting to use a strstr()
to find the first occurrence of a double quote ("), however, when I use this line of code:
pch = strstr(tmp,""");
It won't compile because I don't have a terminating quote. So I used
pch = strstr(tmp,'"');
which then tells me I have an error like this:
passing argument 2 of ‘strstr’ makes pointer from integer without a cast [enabled by default]
pch = strstr(tmp,'"'); //finds the first occurrence and deletes the preceeding
^
In file included from /usr/include/stdio.h:29:0,
from assignment1.c:1:
/usr/include/string.h:40:8: note: expected ‘const char *’ but argument is of type ‘int’
char *_EXFUN(strstr,(const char *, const char *));
Any ideas around this or does anyone know of a way to use strstr
to detect a double quote character? Maybe with ASCII conversions?