codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
int main() { //stack allocation syntax 1 string s = string("Sayounara"); cout << s << endl; //stack allocation syntax 2 string t("Goodbye"); cout << t << endl; //heap allocation string *u = new string("Au revoir"); cout << *u << endl; //stack allocation syntax 3 string v; v.assign("Arrivederci"); cout << v << endl; return 0; }
Private
[
?
]
Run code
Submit