hi all,
i am writing a program in which i am checking if a string contains another string(same what strstr does).
i assumed intially that the string1 is a long string with spaces and string2 is a word(which might be or might not be present in string1)
i have used strtok to seperate the words in string1 to be checked using strcmp.
its a very simple logic, but the problem is its showing segmentation fault.
can anyone find me a solution.
rati 0 Junior Poster in Training
iamthwee
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Narue 5,707 Bad Cop Team Colleague
rati 0 Junior Poster in Training
rati 0 Junior Poster in Training
Salem 5,199 Posting Sage
rati 0 Junior Poster in Training
John A 1,896 Vampirical Lurker Team Colleague
rati 0 Junior Poster in Training
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster
Narue 5,707 Bad Cop Team Colleague
rati 0 Junior Poster in Training
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.