Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <conio.h>
- using namespace std;
- void exchange(const char*& p1, const char*& p2) {
- p1 = p2;
- }
- void wow(const char*& p) {
- char ceva[256] = "";
- strcpy_s(ceva, "hahalero");
- char* p2 = ( char*)malloc(sizeof( char) * 255);
- int i = 0;
- for (const char *p = ceva; *p != '\0'; ++p) {
- *(p2 + i++) = *(p);
- }
- p2[i] = '\0';
- exchange(p, p2);
- }
- void main() {
- int x = 5;
- const char* p;// = (const char*)malloc(sizeof(const char) * 255);
- wow(p);
- cout << p;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement