Good evening:
I have finally "fixed" (really, many people here helped,) my code, and now it compiles error-free which is nice; Upon runtime, though, it is apparent that the primary goal of this snippet of code is not accomplished, that is, "return the substring ("good") and allow it to act as a trigger for a function, a Boolean result which spits out a cout." Very relieved no errors at this point, but little designed results. Just some hints, etc should anyone care to assist.
Thank-you,
reRanger
Code:#include <stdio.h> #include <fstream> #include <iostream> #include <string.h> #include <windows.h> using namespace std; int main() { char str[]="good"; char grabber[256]; cout<< "Hello, how are you today?\n"<< endl; cin.getline(grabber,256); char * pch; pch=strstr (str, "good"); //Searching for “good” in ^ Char str if(pch !=NULL) cout<< "I am glad to hear you are doing well today."<< endl; else cout<< "Is anything wrong at all? Would you like to discuss it? \n"<< endl; Sleep(50000); return 0; //END }![]()



LinkBack URL
About LinkBacks
) my code, and now it compiles error-free which is nice; Upon runtime, though, it is apparent that the primary goal of this snippet of code is not accomplished, that is, "return the substring ("good") and allow it to act as a trigger for a function, a Boolean result which spits out a cout." Very relieved no errors at this point, but little designed results. Just some hints, etc should anyone care to assist.


