DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   C (http://www.daniweb.com/forums/forum118.html)
-   -   struct dynamic 2d array alloc (http://www.daniweb.com/forums/thread1144.html)

Valmian Sep 21st, 2003 1:11 am
struct dynamic 2d array alloc
 
ok.. here I am with a double pointer to a 2D array and I am copying the data from another struct in to this 2d struct array.
It gives me an illegal opperand error.
Code:
data.rows=polar.rows;
data.trace = (SQwPOL**)calloc(polar.width,sizeof (SQwPOL*));
for (int i=0; i<polar.width; i++)
{
data.trace[i]= (SQwPOL*)calloc(polar.width,sizeof (SQwPOL));
for (int a=0; a<data.rows; a++)
{

data.trace[i][a]=polar.ar[i].values[a]; //says it is an illeal opperand here
printf ("\nThe number copy #%d = %d, original #%d = %d",i,data.trace[i][a],i,polar.ar[i].values[a]);
}
}


All times are GMT -4. The time now is 5:56 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC