#include <iostream>
using namespace std;
int main() {
int input;
cout<<"type s";
(input == char*s) cout<<"good";
}
i typed this simple code when you press s it will say good but it wont work and i get this
[Error] expected primary-expression before 'char'
when i try this code it gives me [Error] expected primary-expression before ‘char’. idk why this is happening and i know this probably looks like a mess to experienced people
>Solution :
The code you wrote does not make any sense. I don’t know where you are getting your information from but you need to learn C++ from a good source. You cannot learn C++ by trial and error.
Something like this code will do something like what you want
#include <iostream>
using namespace std;
int main() {
cout<<"type s\n";
char input;
cin >> input;
if (input == 's') cout<<"good\n";
}