Last active
August 29, 2015 13:56
-
-
Save aalaap/9058982 to your computer and use it in GitHub Desktop.
strdoge(): inspired by strcat(). such wow, much code.
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
#include <iostream> | |
#include <sstream> | |
using namespace std; | |
/* supply words and strdoge() will echo the doge and strdog() will return the doge */ | |
string strdog(string so, string such, string very, string much); | |
void strdoge(string so, string such, string very, string much); | |
int main() { | |
using namespace std; | |
string so, such, very, much; | |
cout << "Enter doge: "; | |
cin >> so >> such >> very >> much; | |
strdoge(so, such, very, much); | |
return 0; | |
} | |
string strdog(string so, string such, string very, string much) { | |
using namespace std; | |
string t = "\t\t"; | |
stringstream dog; | |
dog << "wow" << t << t | |
<< "so " << so << t << t | |
<< "such " << such << t << t | |
<< "very " << very << t << t | |
<< "much " << much << t << t; | |
return dog.str(); | |
} | |
void strdoge(string so, string such, string very, string much) { | |
using namespace std; | |
cout << strdog(so, such, very, much) << endl; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm learning C++ and I felt this was a good way to experiment.
Compiles with gcc 4.8 on OS X.