mercredi 12 août 2020

in C++, how to simplify many for loops with multi-arrays?

In practice, I will come across some big loops. for instance, I use eight arrays, like "double a[7]={0,1,2,3,4,5,6}", to loop these conditions for the eight attributes. to achieve this goal, I have to do eight (for-if ) loops as a nested loop.

  1. it is a bit ugly and hard to change. 2 even I put these arrays in the global region, there will be segmentation errors when arrays large enough. Do we have some structure-strategies to handle this case? thanks a lotenter image description here

Aucun commentaire:

Enregistrer un commentaire