in c++ you could simply use the new operator to allocate memory.
Code:
//create a pointer to a "block" of memory
char *buffer = new char [2000];
just be sure you delete ( delete [] buffer; ) it when you done.
also to check if your allocating bad memory.
Code:
char *buffer; //create pointer to memory
try {
buffer = new char [2000]; //allocate memory
memset(buffer, 0, sizeof(buffer));
}
catch(bad_alloc & b) { // catch the exception if something went wrong
cout << b.what();
}
EDIT: also if you need further help, post your code and you will most definately get the answers you seek