dimanche 29 janvier 2017

How to initialize all members of a fixed-size array to the same, changeable value [duplicate]

This question already has an answer here:

First have a look at How to initialize all members of an array to the same value.

I like mouviciel's answer, but I find myself in a situation where the size of a fixed-size array needs to be changed very often in the code.

Which alternatives, if any, do I have (besides initializing it manually or using a for loop)?

Aucun commentaire:

Enregistrer un commentaire