rajanikant
Programmer
Here gOES....
I have a ** pointer "cohesion_table". I have allocated memory and written data into it. Now I want to copy it into a new **pointer array called "tree_table".
The code below is simple 2 loop structure to copy one table into another. NOW THE STRANGE THING HAPPENS.
It works fine until i=12 and j=236. Here after
tree_table[12][236]=cohesion[12][236]
the pointer for cohesion[12] becomes 0x0.....????
It has a valid address until then.
Any Idea Why???
**************************************
The 2 loop structure if U need them
****************************************
for(i=0;i<assigned_port_ct;i++)
{
tree_table=( int *)
my_malloc(assigned_port_ct*sizeof(int));
for(j=0;j<assigned_port_ct;j++)
{
tree_table[j]=cohesion_table[j];
}
}
I have a ** pointer "cohesion_table". I have allocated memory and written data into it. Now I want to copy it into a new **pointer array called "tree_table".
The code below is simple 2 loop structure to copy one table into another. NOW THE STRANGE THING HAPPENS.
It works fine until i=12 and j=236. Here after
tree_table[12][236]=cohesion[12][236]
the pointer for cohesion[12] becomes 0x0.....????
It has a valid address until then.
Any Idea Why???
**************************************
The 2 loop structure if U need them
****************************************
for(i=0;i<assigned_port_ct;i++)
{
tree_table=( int *)
my_malloc(assigned_port_ct*sizeof(int));
for(j=0;j<assigned_port_ct;j++)
{
tree_table[j]=cohesion_table[j];
}
}