I'm having trouble with the code below.
I know strchr and strrchr both take int's as the second argument but I don't know how to make it work the way I want.
With strrchr I manually pass '/' as the second argument and it works.
I've tried different int's & chars using typecasting but I can't make it work by passing a variable. I don't know why it takes an int when likely we are going to be searching for some chars?
Here is the current code and error I get.
Thanks so much for your help guys!
lastoccurrence.c: In function `main':
lastoccurrence.c:29: warning: passing arg 2 of `strchr' makes integer from pointer without a cast
int main(int argc, char *argv)
if( argc != 2 )
printf("WTF: You need to enter 1 arguments: The string to search in\n");
printf("String To Search=%s\n",stringtosearch);
printf("ARG1 (string to search)=%s\n",stringsearch);