Hi...can someone please help me with the above as its preventing my strstr function from performing correctly....any pointers much appreciated as I am a beginner....
Printable View
Hi...can someone please help me with the above as its preventing my strstr function from performing correctly....any pointers much appreciated as I am a beginner....
char *p = strchr( buff, '\n' ) if ( p ) *p = '\0';
If you're reading input using fgets(), this is all discussed in the FAQ
Just a minor nit... A missing ';', it should readQuote:
Originally Posted by Salem
Salem knows this, it's just a typo...Code:char *p = strchr( buff, '\n' ); if ( p ) *p = '\0';
And don't forget <string.h>.
Here's the relevant FAQ entry: http://faq.cprogramming.com/cgi-bin/...&id=1043284385