i want some lesson for dynamic declaration
-
Hi, I have an array like this : char sArray[4][5]; I want to declare this array with new or malloc like this :
char** sArray=NULL; sArray = new char[20]; or sArray = (char*)malloc(20);
Can anybody help me to write correct declaration Thanks in advance -
Hi, I have an array like this : char sArray[4][5]; I want to declare this array with new or malloc like this :
char** sArray=NULL; sArray = new char[20]; or sArray = (char*)malloc(20);
Can anybody help me to write correct declaration Thanks in advancethere is no simple way to do it in C++. you will have to do something like this:
// alloc an array of arrays
int ** array = new int* [sizex];
for (int i = 0; i < sizex; ++i)
array[i] = new int[sizez];-c
"Half of the harm that is done in this world is due to people who want to feel important." -- TS Elliot