c++ - what is the result of pointer of a type & valiable -


i trying understand code. not understand last line? result of *(uint8_t*)&b[8]=?

typedef uint8_t a; uint8_t *b = new uint8_t[100]; rpc_flags_t c; c=0u; *((a*)&(b[8]))=c; 

it obfuscation of b[8] = c;

  • &(b[8]) b + 8 (or address of b[8])
  • (a*)&(b[8]) cast a* uint8_t* type of b + 8, equivalent &(b[8])
  • *((a*)&(b[8])) *&(b[8]) b[8].

Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -