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

iphone - Three second countdown in cocos2d -

hyperlink - how to do url routing in php -

c++ - CryptStringToBinary API behavior -