On the right side is a pointer to an int.
On the left side is a variable (somevar) of unknown type, passed to a pointer to an int. It would be good to advise looking at someone with a critical eye. Sometimes casting in C is required; but, most often, casting in C indicates that the wrong type was selected for somevar or that you are doing something that is unlikely to be portable.
In this case, you are wrapping characters in ints. Depending on the system, you can get an int with an internal bit representation that matches [char0, char1, char2, char3], followed by another int with an internal bit representation that matches characters four through seven.
However, on some other systems you can get with int with the internal bit representation [char3, char2, char1, char0]. Finally, there are other systems that handle the order of bits even more differently.
The odds are good in that if you dig the code enough, you will find that there is another place where the pointer to your "built" int returns to char *.
source share