Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
why
#include <iostream> #include <set> using namespace std; set<string> stringSet; struct StringStruct { string str; }; void referencePass(StringStruct & str) { stringSet.insert(str.str); } void insertIntoGlobal() { for (int i = 0; i < 2; i ++) { string asdf; cin >> asdf; StringStruct a = {asdf}; referencePass(a); } } int main() { insertIntoGlobal(); for (auto itr : stringSet) { cout << itr << endl; } return 0; }
run
|
edit
|
history
|
help
0
function pointer
Balanced Insert Example
ternary test
virtual members
marquee text in C++
Access to temporary object
Magic, why 1 2?
wellformed number
Test titlu
illegal instruction (SIGILL)