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

Popular posts from this blog

c++ - CryptStringToBinary API behavior -

c++ - Correct method for redrawing a layered window -

java.util.scanner - How to read and add only numbers to array from a text file -