C++ convert strings to char arrays
I want to have 2 strings as input so I can use getline(cin,s) (so I can pick the whole line until '\n' ) and then I want to search the second array if it contains the word of the first array without using string::find() or strstr() . But I still can't find a way to either convert strings to arrays int main() { string s; string s2; char array[50]; char array2[50]; cout<<"Give me the first word"<<endl; getline(cin,s); cout<<"Give me the text"<<endl; getline(cin.s2); array=s; array2=s2; } The second way I was thinking was doing the job from the start with arrays: char array[50]; cin.getline(array