Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Meet and Greet (http://www.go4expert.com/community/meet-and-greet/)
-   -   memory allocation problem in 2d array (http://www.go4expert.com/community/memory-allocation-2d-array-t9283/)

rinuvc 12Mar2008 20:02

memory allocation problem in 2d array
 
hi all

am havin a problem with memory allocation of 2d array

can any body help me out ...


it goes like this

char ** a;

in a loop for each time

a[i] = new char(strlen(name)+1);

strcpy(a[i],name);

a[i][strlen(name)+1]='\0';


in a loop i deallocate it with

delete[] a[i];

after the loop

delete [] a;



can any body help me with this ????
thanks in advance...

asadullah.ansari 13Mar2008 10:20

Re: memory allocation problem in 2d array
 
First this is not right place to query. Just go querry and suggestion and put there your querry.
and other thing is that this thread is duplicate of thread
http://www.go4expert.com/showthread.php?t=9285

The same person post this querry two times.

Please read the rule. Before posting any article or querry, just search that title ap per rule.

shabbir 13Mar2008 11:41

Re: memory allocation problem in 2d array
 
Duplicate of memory allocation problem in 2d array. Thread closed.


All times are GMT +5.5. The time now is 23:58.