vendredi 17 avril 2015

Zero-initialize data using value-initialized array

Will the following code correctly zero-initialize the memory returned from malloc?



#include <cstdlib>
#include <new>

int main()
{
char* p = new (std::malloc(10)) char[10]{};
}

Aucun commentaire:

Enregistrer un commentaire