0

Hello, I need to search a char array, for a particular word... E.g.

char * search;
char arr[10] = {'b', 'c', 'a', 't', 'h', 'e', 'p', 'h'};
string words[1] = {"the"};

search = strstr (alphabet, words);

But it doesn't work... Any ideas what the problem could be?

Thanks :)

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by thines01
1

First don't make a string[]. Just use a string.
OR compare it to words[0];

Edited by thines01: typo

Votes + Comments
Great help, thank you :)
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.