Conversion of integer pointer to integer

后端 未结 4 703
春和景丽
春和景丽 2021-01-17 21:43

Tried following code to check what happens when we convert integer pointer to a integer .

 #include
 #include
 int main()
 {
          


        
4条回答
  •  执笔经年
    2021-01-17 22:03

    uint64_t PointerToInt(void* ptr){
        uint64_t* u=(void*)&ptr;
        return *u;
    }
    

    if you want to convert pointer to 64 bits unsigned int

提交回复
热议问题