Last active
April 9, 2017 04:27
-
-
Save eu90h/6526bb2dcef4798d19380a03cbd87f44 to your computer and use it in GitHub Desktop.
Example program used to examine string layouts for this article: https://eu90h.github.io/cpp-strings.html
This file contains hidden or 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
// Compile with -O3 | |
#include <string> | |
#include <stdlib.h> | |
#include <iostream> | |
using namespace std; | |
int main(int argc, char *argv[]) { | |
string greeting("Hello, "); | |
string name = argv[1]; | |
cout << greeting.append(name) << endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment