Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <string>
- #include <iostream>
- using namespace std;
- void some_function(string str)
- {
- cout << "str : " << str.c_str() <<endl;
- }
- int main() {
- const char* cstr = "Hello World!";
- some_function(string(cstr));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement