déclarer un string a partir d'une variable
Bonjour,
Je désire déclarer une suite de variables, dont le dernier caractère du nom est incrémenté.
Par exemple :
Code:
1 2 3 4
| ucstring variable1;
ucstring variable2;
ucstring variable3;
... |
Pour cela je concatène deux string :
Code:
1 2 3 4 5 6 7 8 9 10
|
int NombreDeVariable = 5;
int i = 0;
while (i<NombreDeVariable)
{
ucstring j.fromUtf8(i); // Converti int en ucstring
ucstring test = "variable";
ucstring variable = test += j; // Concatenation
i++;} |
variable prend donc les valeurs : "variable1, variable2,...".
Le problème est que je ne sais pas comment déclarer une variable qui à pour nom (et non pas pour valeur) "variable1, variable2,...".