Advertisement
Guest User

Untitled

a guest
Jul 25th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. void test(const string& str)
  6. {
  7. static const char * const c = str.c_str();
  8. cout << c << endl;
  9. }
  10.  
  11. int main(int argc, char* argv[])
  12. {
  13. test("Hello");
  14. test("Nooo");
  15. return 0;
  16. }
  17.  
  18. Hello
  19. Hello
  20.  
  21. Hello
  22. Nooo
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement