Advertisement
Guest User

cstr

a guest
Oct 22nd, 2012
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.23 KB | None | 0 0
  1. #include <string>
  2. #include <iostream>
  3.  
  4. using namespace std;
  5.  
  6. void some_function(string str)
  7. {
  8.     cout << "str : " << str.c_str() <<endl;
  9. }
  10.  
  11. int main() {
  12.   const char* cstr = "Hello World!";
  13.   some_function(string(cstr));
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement