[En-Nut-Discussion] Receiving data problem
ulrich.hertlein at artcom.de
Mon Jan 22 12:41:25 CET 2007
MUHAMMAD AZEEM AZAM wrote:
> i am unable to sent 2d ARRAY TO MY CLIENT ON PC.
> the code is below.
> I have to use tcp sockets.
> i need to send "char var" this array.
> "char var" this thing is working but after that my client application hangs.
> if (strncmp(buff, "2darray", got_data) == 0) //If Match
> int a = 5;
> int b = 128;
> char mvar[a][b];
> char mvarr;
When using variables like that you're allocating from the stack.
It's possible you're overwriting your stack and thereby messing up your app.
Try using malloc to allocate from the heap and see if it makes a difference.
Ulrich Hertlein | Software Development
Kleiststr. 23-26 | 10787 Berlin | Germany
More information about the En-Nut-Discussion