Im trying to scan a character from input , i have tried all method , scanf() getline() fgets()
but all contains null terminator '\0'
at the end which is unwanted for me . How can i strip it? I have tried
char *p=strtok(string,'\0\')
but it didnt work. How can i do it?
I am scanning strings usgin getline()
into an array of string , which works fine and i want to input an "needle" which i am trying to scanf with getline() too and than use strstr to find match but '\0' is causing no match