1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | #include <sstream> #include <iostream> #include <string> using namespace std; // Prints the MAC address stored in a 6 byte array to stdout void PrintMACaddress() { printf("00-19-D7-53-2D-14"); } // Fetches the MAC address and prints it void GetMACAddress() { PrintMACaddress(); // Print MAC address } int main() { stringstream ss; streambuf* old = std::cout.rdbuf(ss.rdbuf()); GetMACAddress(); string theStr = ss.str(); cout << theStr << endl; cout << "Hello world" << endl; std::cout.rdbuf(old); cout << "Hello world" << endl; } |
I2luY2x1ZGUgPHNzdHJlYW0+CiNpbmNsdWRlIDxpb3N0cmVhbT4KI2luY2x1ZGUgPHN0cmluZz4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCi8vIFByaW50cyB0aGUgTUFDIGFkZHJlc3Mgc3RvcmVkIGluIGEgNiBieXRlIGFycmF5IHRvIHN0ZG91dAp2b2lkIFByaW50TUFDYWRkcmVzcygpCnsKICAgIHByaW50ZigiMDAtMTktRDctNTMtMkQtMTQiKTsKfQoKLy8gRmV0Y2hlcyB0aGUgTUFDIGFkZHJlc3MgYW5kIHByaW50cyBpdAp2b2lkIEdldE1BQ0FkZHJlc3MoKQp7CiAgICBQcmludE1BQ2FkZHJlc3MoKTsgLy8gUHJpbnQgTUFDIGFkZHJlc3MKfQoKaW50IG1haW4oKQp7CiAgICBzdHJpbmdzdHJlYW0gc3M7CiAgICBzdHJlYW1idWYqIG9sZCA9IHN0ZDo6Y291dC5yZGJ1Zihzcy5yZGJ1ZigpKTsKICAgIAogICAgR2V0TUFDQWRkcmVzcygpOwogICAgCiAgICBzdHJpbmcgdGhlU3RyID0gc3Muc3RyKCk7CiAgICBjb3V0IDw8IHRoZVN0ciA8PCBlbmRsOwogICAgY291dCA8PCAiSGVsbG8gd29ybGQiIDw8IGVuZGw7CiAgICAKICAgIHN0ZDo6Y291dC5yZGJ1ZihvbGQpOwogICAgY291dCA8PCAiSGVsbG8gd29ybGQiIDw8IGVuZGw7Cn0=
-
upload with new input
-
result: Success time: 0.01s memory: 2816 kB returned value: 0
00-19-D7-53-2D-14Hello world


