Last active
July 15, 2018 02:55
-
-
Save rafalcieslak/1200e25ce296ad68b13abbe87f9c7fd2 to your computer and use it in GitHub Desktop.
C++ Quine
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
int main() { | |
std::string code1 = R"( | |
#include <iostream> | |
int main() { | |
)"; | |
std::string code2 = R"( | |
std::cout << code1 | |
<< " std::string code1 = R\"(" << code1 << ")\";\n" | |
<< " std::string code2 = R\"(" << code2 << ")\";\n" | |
<< code2; | |
} | |
)"; | |
std::cout << code1 | |
<< " std::string code1 = R\"(" << code1 << ")\";\n" | |
<< " std::string code2 = R\"(" << code2 << ")\";\n" | |
<< code2; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
std::cout << code1
error C2679: binary '<<': no operator found which takes a right-hand operand of type 'std::string' (or there is no acceptable conversion)
You forget to
#include < string >