mercredi 1 août 2018

Multidimensional array initialization in C++

I'm reading "Sams Teach Yourself C++ in One Hour a Day" and get stuck with "Lesson 4". It says that I can initialize all elements of multidimensional array with the following code:

int x[n][m] = {1};

But as I understand it's wrong. This code creates array with only one element (x[0][0]) equals 1. Is it a mistake in the book or what?

Aucun commentaire:

Enregistrer un commentaire