Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@aalaap
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aalaap/9058982 to your computer and use it in GitHub Desktop.
Save aalaap/9058982 to your computer and use it in GitHub Desktop.
strdoge(): inspired by strcat(). such wow, much code.
#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;
}
@aalaap
Copy link
Author

aalaap commented Feb 17, 2014

I'm learning C++ and I felt this was a good way to experiment.

Compiles with gcc 4.8 on OS X.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment