Page 1 of 1

CHALLENGE 11.4.2: Find char in C string ACTIVITY Assign a pointer to any instance of searchChar in personName to searchR

Posted: Sun Jul 03, 2022 9:59 am
by answerhappygod
Challenge 11 4 2 Find Char In C String Activity Assign A Pointer To Any Instance Of Searchchar In Personname To Searchr 1
Challenge 11 4 2 Find Char In C String Activity Assign A Pointer To Any Instance Of Searchchar In Personname To Searchr 1 (54.16 KiB) Viewed 18 times
#include <iostream>#include <cstring>using namespace std;
int main() { char personName[100]; char searchChar; char* searchResult = nullptr;
cin.getline(personName, 100); cin >> searchChar;
/* Your solution goes here */
if (searchResult != nullptr) { cout << "Character found." <<endl; } else { cout << "Character not found." <<endl; }
return 0;}
CHALLENGE 11.4.2: Find char in C string ACTIVITY Assign a pointer to any instance of searchChar in personName to searchResult. 397756.2392630.qx3zqy7 1 #include <iostream> 2 #include <cstring> 3 using namespace std; 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 int main() { char personName [100]; char searchChar; char search Result = nullptr; cin.getline (personName, 100); cin >> searchChar; /* Your solution goes here */ if (searchResult != nullptr) { cout << "Character found." << endl; } else { Doll passed