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

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -