include iostream include string using namespace std void select char s

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <iostream>
#include <string.h>
using namespace std;
void select(char string[], char search) {
char *link;
for (link = strtok(string, " "); link; link = strtok(NULL, " ")) {
if (strchr(link, search) != NULL) {
puts(link);
}
}
}
int main() {
char string[128] = "", search;
cout << "Enter string:" << endl;
cin.getline(string, sizeof(string));
cout << "Enter symbol what do you want search:" << endl;
cin >> search;
cout << "Search result:" << endl;
select(string, search);
return 0;
}