visual c++: convert int into string pointer

前端 未结 10 2135
既然无缘
既然无缘 2021-01-22 09:01

how to convert integer into string pointer in visual c++?

10条回答
  •  天涯浪人
    2021-01-22 09:29

    If you want a textual representation of the pointer address use sprintf. If you want to treat the numeric value as a pointer to a string use casting like so:

    int intValue = ...;
    char * charPtr = (char*)intValue;
    

提交回复
热议问题