Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
C++ quine
#include <iostream> #include <string> using namespace std; int main(int argc, char* argv[]) { char q = 34; string l[] = { " ", "#include <iostream>", "#include <string>", "using namespace std;", "", "int main(int argc, char* argv[])", "{", " char q = 34;", " string l[] = {", " };", " for(int i = 1; i <= 8; i++)", " cout << l[i] << endl;", " for(int i = 0; i <= 17; i++)", " cout << l[0] + q + l[i] + q + ',' << endl;", " for(int i = 9; i <= 17; i++)", " cout << l[i] << endl;", " return 0;", "}", }; for(int i = 1; i <= 8; i++) cout << l[i] << endl; for(int i = 0; i <= 17; i++) cout << l[0] + q + l[i] + q + ',' << endl; for(int i = 9; i <= 17; i++) cout << l[i] << endl; return 0; }
run
|
edit
|
history
|
help
0
c++
Regex pipe and tabs c++
Zero
get_number_of_threads, windows
constmsvc
#33
Copy double[2][3] into vector<vector<double>>
SFINAE with std::enable_if
Preserving strict aliasing Union example
C++ instantiation