Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- char * aString = "This is a string.";
- char aString[] = "This is a string.";
- int someNumber;
- int * someNumber = new int;
- char *aString = "This is a string.";
- char aString[] = "This is a string.";
- int someNumber;
- int *someNumber = new int;
- void func() {
- char foo[] = "hello";
- cout << foo << endl;
- foo[2] = 'w';
- foo[3] = 'w';
- cout << foo << endl;
- }
- func();
- func();
- hello
- hewwo
- hello
- hewwo
- void func() {
- const char* c_foo = "hello";
- char* foo = const_cast<char*>(c_foo);
- cout << foo << endl;
- foo[2] = 'w';
- foo[3] = 'w';
- cout << foo << endl;
- }
- hello
- hewwo
- hewwo
- hewwo
Add Comment
Please, Sign In to add comment