char *p=" My name is xyz ";
char *q;
q=strstr(p,"name");//it will return ptr at n of name
now if i want to extract "name" from p i will increment the ptr q and put it in a char array say str[] but
how will i check for space after name so that it stops and shouldn include
is xyz
i tried if(*q=="") but it gave an error
gamodg
0
Newbie Poster
Recommended Answers
Jump to Post>>i tried if(*q=="") but it gave an error
use single quotes with a space between them, like this:if(*q==' ')
All 4 Replies
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
~s.o.s~
2,560
Failure as a human
Team Colleague
Featured Poster
gamodg
0
Newbie Poster
John A
1,896
Vampirical Lurker
Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.