void* malloc(size_t qMemorySize);
#include <iostream>
#include <cstdlib>
int main() {
using namespace std;
char* cpArray = (char*)malloc(9);
cpArray[0] = 'X';
cpArray[1] = 'o';
cpArray[2] = 'a';
cpArray[3] = 'X';
cpArray[4] = '.';
cpArray[5] = 'n';
cpArray[6] = 'e';
cpArray[7] = 't';
cpArray[8] = 0;
cout << cpArray << endl;
// Deallocate the memory
free(cpArray);
return 0;
}
© 20072024 XoaX.net LLC. All rights reserved.