I am trying to send and recieve a 5x5 int array. (I posted this in the C forum but just found out i overlooked this forum which is probably the proper place for a Q like this)
In my code I have for sending(UDP) int distvector[5][5]:
Code:
remoteServAddr.sin_port = htons(5000+i*1000);
rc = sendto(sd, &distvector, sizeof((int)distvector[5][5]), 0,
(struct sockaddr *) &remoteServAddr,
sizeof(remoteServAddr));
And for recieving I have (UDP) int recv_DV[5][5]:
Code:
recvfrom(sd, &recv_DV, sizeof((int)recv_DV[5][5]), 0,
(struct sockaddr *) &cliAddr, &cliLen);
i dont recieve the right array, recv_DV[0][0] has an odd number in it (I suppose its the array's address) and the rest of the array is '0'. Also in the sendto() function I used distvector instead of &distvector but still the same result.
ne help would be much appreciated.
thnxs