c - How do you cast a pointer to a character without using an ampersand? -


For a project I want to push the pointer from an int to switch a byte Hex There is only one warning on prices that I am not allowed to use ampersand.

So I've worked with this line of code:

  int x = 5000; Char * ptr = (four *) & amp; X;  

But clearly I need to find a way to insert this indicator without using ampersands. Does anyone know of a way to do this? I am searching and I have not found a way that is not included in the use of ampersands or other operators to use me (|, [,], >, ^) Not allowed.

Make an association.

  union myUnion {int x; Four c [4]; } U; Char * ptr = u.c; U.x = 5000;  

Comments

Popular posts from this blog

HTML/CSS - Automatically set height width from background image? -

php - Mysql Show Process - Sleep Commands and what to do -

c - What is the address of buf (the local variable in the main function)? -