c++ - What does this code output a smiley face? -
#include <iostream> #include <string> using namespace std; int main(){ string x; x = not false , true; cout << x << endl; } why code output smiley face when ran?
nothing wrong code.
not false , true equivalent !false && true 1.
then use std::string::operator=(char) assign value x. value of 1 char apparently translates smiley on system.
Comments
Post a Comment