language: C++ 4.7.2 (gcc-4.7.2)
date: 171 days 12 hours ago
link:
visibility: public
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;
}