Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- void PrintString(char* cstring, std::string stdstring)
- {
- std::cout << cstring << std::endl;
- std::cout << stdstring << std::endl;
- }
- int main()
- {
- char cst[] = {'a', 'n', 'a', '\0'};
- std::string stdst = "ana";
- PrintString(cst, stdst);
- cst[3] = '3';
- cst[4] = '\0';
- PrintString(cst, stdst);
- stdst.append("4");
- PrintString(cst, stdst);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement