Printing a void* variable in C

前端 未结 3 716
再見小時候
再見小時候 2021-02-01 05:55

Hi all I want to do a debug with printf. But I don\'t know how to print the \"out\" variable.

Before the return, I want to print this value, but its type is void* .

3条回答
  •  南方客
    南方客 (楼主)
    2021-02-01 06:21

    printf("%p\n", out);
    

    is the correct way to print a (void*) pointer.

提交回复
热议问题