This if(argv[1] != D||A||R||B)
is not proper syntax
D
,A
,R
, and B
have not been initialized to anything! They are what you call variables.
nor do you have a main()
function. You are missing a lot here, but I will answer how to check for the right char
.
you will probably be better served by a switch statement
:
switch (*argv[1])
{
case 'D':
case 'A':
case 'R':
case 'B':
cout << "Not Q" << endl;
break;
case 'Q':
cout << "We have a Q" << endl;
break;
default:
cout << "unknown char" << endl;
break;
}
There are a lot of other things we could get into here, such as how to properly structure a program, or general C/C++ questions, but this should get you at least started.