I whant to have a array like this:
Msg[0] = 436;
Msg[1] = 4;
The values are stored in another array. My code are like this:
It output 51 and 53...Code:#include <stdio.h> #include <stdlib.h> void main() { int DP[2]; //DP = malloc(2*sizeof(int)); char *Msg; Msg = malloc(2*sizeof(int)); DP[0] = 436; DP[1] = 3; sprintf(&Msg[0],"%d",DP[0]); sprintf(&Msg[1],"%d",DP[1]); printf("%d\n",Msg[0]); printf("%d\n",Msg[1]); }