Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- int main() {
- const char* c = "hi";
- int n = 2;
- char* s = new char[n];
- for (int i = 0; i < n; ++i)
- s[n - 1 - i] = c[i];
- std::cout << s;
- delete[] s;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement