- #1
ineedhelpnow
- 651
- 0
Assign the first instance of The in movieTitle to movieResult.
Sample program:
I have no idea how to do this. I was thinking to use either the strrchr function or strchr but I'm not sure which one. Something like movieResult=strrchr(movieTitle, ?) but I'm really confused.
Sample program:
Code:
#include <iostream>
#include <cstring>
using namespace std;
int main() {
char movieTitle[100] = "The Lion King";
char* movieResult = 0;
<STUDENT CODE>
cout << "Movie title contains The? ";
if (movieResult != 0) {
cout << "Yes." << endl;
}
else {
cout << "No." << endl;
}
return 0;
}
I have no idea how to do this. I was thinking to use either the strrchr function or strchr but I'm not sure which one. Something like movieResult=strrchr(movieTitle, ?) but I'm really confused.