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,50);
But if I use straight arrays is there any way I can find the length of the array like we do on strings?
//example
string s;
int x;
getline(cin,s);
x=line.length();