$ g++ -op p.cpp
p.cpp: In function ‘int main()’:
p.cpp:13:20: error: no match for ‘operator&&’ (operand types are ‘char’ and ‘std::basic_string<char>’)
if ((n=1)&&((a='a')&&(c="cc")))
^
p.cpp:13:20: note: candidate is:
p.cpp:13:20: note: operator&&(bool, bool) <built-in>
p.cpp:13:20: note: no known conversion for argument 2 from ‘std::basic_string<char>’ to ‘bool’
#include<iostream>
#include<cstring>
usingnamespace std;
int main()
{
int n;
string c ;
char a;
cout<<"ENter number ,and two words"<<endl;
cin>>n>>a>>c;
if ((n=1)&&((a='a')&&(c="cc")))
{
cout<<"test"<<endl;
}
return 0;
}