vendredi 1 septembre 2017

How to declare a void pointer using auto?

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?

auto ptr = (void*)nullptr;
auto ptr = (void*)0;

Aucun commentaire:

Enregistrer un commentaire