hi , <br> Here is the code which will surely help you ... <br> You have made many mistakes .. like you have use 'memcpy' for assigning memory , in-fact it is use to copy a memory block.<br> If you still have any problem then you are welcome.<br><br>#include <stdio.h> <br>#include <stdlib.h><br>#include <string.h><br><br>void displacement_from_source(int X, int u_position[4][2],int* rx_displacement[6]);<br>void print_out_arrays(int X, int* rx_displacement[6]);<br><br>// Main Program<br>void main ()<br>{<br><br>/* these are not global variables */<br><br>int i,j;<br>int u_position[4][2]={5,6,7,8,9,10,11,12};<br>int X;<br>int* rx_displacement[6]; //array of pointers<br>int*tx; <br>int temp_array[4][2];<br><br>for (X=0; X<6; X++) // go through six times to form the six integer arrays<br>{<br>displacement_from_source(X,u_position,rx_displacement);<br>}<br><br>for (X=0; X<6; X++) //go through six times to print arrays<br>{<br>tx=rx_displacement[X]; //assign pointer tx the first interarray address<br>memcpy(temp_array,tx, 8*sizeof(int)); //assign this address to temp_array<br><br>for (i=0;i<4;i++)<br>{<br>for (j=0;j<2;j++)<br>{ <br>printf("%d\n", temp_array[j]);<br>}<br>}<br>}<br><br>}<br><br>void displacement_from_source(int X, int u_position[4][2],int* rx_displacement[6])<br>{<br><br>int i,j;<br><br>int rx_array[4][2];<br>int rx_temp[4][2];<br>int* rx;<br>int* tx;<br> <br>memcpy(rx,rx_temp, 8*sizeof(int)); //assign the address of rx_temp to the pointer rx<br>rx_displacement[X]=rx; //assign the address of rx to the array of pointer's Xth<br>for (i=0;i<4;i++)<br>{<br>for (j=0;j<2;j++)<br>{<br>rx_temp[j]=u_position[j]; <br>}<br>}<br>}<br><br><br> <p>Bhaskar Bora<br><a href=mailto:bhaskar_bora@yahoo.com>bhaskar_bora@yahoo.com</a><br><a href= > </a><br>___________________________________________________________<br>
C and C++ are too Cool ... Like CoSSAP ..<br>
Ooops What's this CoSSAP...?? <br>
It's a Objected oriented language created by me ...<br>