(compiled on Dev-C++)
Code:
#include <stdio.h>
#include <fstream>
#include <iostream>
#include <string.h>
#include <windows.h>
using namespace std;
int main()
{
char str[]="good"; //Variable
char input1;
{
cout<< "Hello, how are you today?\n"<< endl;
getline(cin);
char * pch;
pch=strstr (input1, 'good'); //Searching for “good” in ^ Char str
if(char str[] !=null) // or perhaps “zero” instead of “null”? or just “str” instead of whole tag…
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
}
errors:
18 no matching function for call to `getline(std::istream&)'
21 [Warning] multi-character character constant
21 call of overloaded `strstr(char&, int)' is ambiguous
56 error candidates are: char* strstr(const char*, const char*) <near match>
125 char* std::strstr(char*, const char*) <near match>
24 syntax error before `!=' token
TY reRanger