CHALLENGE 11.4.3: Find C string in C string. ACTIVITY Assign the first instance of "The" in movie Title to movieResult.
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
CHALLENGE 11.4.3: Find C string in C string. ACTIVITY Assign the first instance of "The" in movie Title to movieResult.
int main() { char movieTitle[100]; char* movieResult = nullptr;
cin.getline(movieTitle, 100);
/* Your solution goes here */
cout << "Movie title contains The? "; if (movieResult != nullptr) { cout << "Yes." << endl; } else { cout << "No." << endl; }
return 0;}
CHALLENGE 11.4.3: Find C string in C string. ACTIVITY Assign the first instance of "The" in movie Title to movieResult. 397756.2392630.qx3zqy7 1 #include <iostream> 2 #include <cstring> 3 using namespace std; 456780 5 int main() { 9 10 11 12 13 char movieTitle [100]; char* movieResult = nullptr; 780 cin.getline (movieTitle, 100); /* Your solution goes here */ cout << "Movie title contains The? "; if (movieResult != nullptr) { cout << "Yes." << endl; 14 15 16 } 17 else { 18 cout << "No." << endl; Doll passed passed