You should also free the memory allocated by malloc() before quitting the program:
And could also add
to the end of your main function.
Oh, and you say
I whant to have a array like this:
Msg[0] = 436;
Msg[1] = 4;
well... since you declare Msg as a char array, you won't be able to have such thing since a char can hold only one character.
One way to solve this is using a 2D array, like
Code:
...
char *Msg[2];
msg[0] = (char *) malloc(...);
msg[1] = (char *) malloc(...);
sprintf(msg[0], "%d", 436);
sprintf(msg[1], "%d", 4);
...
but it's an "overcomplex" solution for this kind of problem, knowing you could do someting like
Code:
char Msg[][15] = {"436", "4"};