Hi
I'm reading from a database that stores information as an integer
representing a char array of ints, it is created in the following
way:
unsigned char examplearray[] = {4, 3, 2, 1};
unsigned int exampleint = *(unsigned int *)examplearray;
and back again using:
unsigned char examplearray2[4];
*(unsigned int*)examplearr ay2 = exampleint;
it works, I just have no clue how it works. Does this technique have a
name so I can look into it?
I'm reading from a database that stores information as an integer
representing a char array of ints, it is created in the following
way:
unsigned char examplearray[] = {4, 3, 2, 1};
unsigned int exampleint = *(unsigned int *)examplearray;
and back again using:
unsigned char examplearray2[4];
*(unsigned int*)examplearr ay2 = exampleint;
it works, I just have no clue how it works. Does this technique have a
name so I can look into it?
Comment