I am trying to store int value in char array, and access it again to retrieve value later. here is what i tried, but it is not working as i am looking for.
char mem[50];
int* size = (int*)&mem[0];
char* isFree = (char*)&mem[4];
char *t = (char *)&mem[4];
Now I want to store 1234, and 'f' in the char array according to the order. (within first 5 bytes)
I am not allowed to use other variables, have to use char array.
int a = 1234;
int *size = &a;
above one is not allowed.