We used to declare a void pointer like this without using auto
.
void* ptr = nullptr;
How should we do the same thing using auto
? Which one should we use? Or maybe there are other better ways?
auto ptr = (void*)nullptr;
auto ptr = (void*)0;
This is not a question about coding style. Just want to know IF we need to use
auto
, what should be the best way.