dimanche 5 mai 2019

Syntax for pointer to std::array c++11

Why is the following wrong?

std::array<double, 10> *p=new std:array<double, 10>;
*p[1]=5;

I thought derefencering the pointer would yield the array and then we could simply update a value?

Aucun commentaire:

Enregistrer un commentaire