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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

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

Post 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 16 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
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply