M
MyCatAlex
Guest
I have this nested structure
struct OutMemStream2 {
struct A1 {
uint8_t n1 = 0; // pixel coordinate
float x1; // pixel amplitude multiplied by Re of function
float y1; // pixel amplitude multiplied by Im of function
} a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
......................................
a81, a82, a83, a84, a85, a86, a87, a88, a89, a90;
} b1, b2, b3, b4, b5, b6, b7, b8, b9, b10,
....................................................
b851, b852, b853, b854, b855, b856, b857, b858, b859, b860,
b861, b862, b863, b864;
It is a large structure but it is still a compromise for me, eventually I will need it to be larger. In order to address variables n1, x1, y1 I tried to shape a part of a command as a content of a string. It looks something like this:
else
{
if (bNumber >= 100 && bNumber <= 864)
{
_itoa_s(bNumber, *buffer3, 3, 10);
bCharNumber = "b" + *buffer3[0] + *buffer3[1] + *buffer3[2];
}
}
}
(&bCharNumber).a1.n1 += 1; <=== syntax error is here.
The syntax error says that this expression must be a class, structure or enum. Well, it is a structure!
The only alternative as I see now is to write a switch, and it will be a nested switch,, but it will be enormous with 864 options and 90 suboptions. Any other ideas?
Thank you, - MyCatAlex
Continue reading...
struct OutMemStream2 {
struct A1 {
uint8_t n1 = 0; // pixel coordinate
float x1; // pixel amplitude multiplied by Re of function
float y1; // pixel amplitude multiplied by Im of function
} a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
......................................
a81, a82, a83, a84, a85, a86, a87, a88, a89, a90;
} b1, b2, b3, b4, b5, b6, b7, b8, b9, b10,
....................................................
b851, b852, b853, b854, b855, b856, b857, b858, b859, b860,
b861, b862, b863, b864;
It is a large structure but it is still a compromise for me, eventually I will need it to be larger. In order to address variables n1, x1, y1 I tried to shape a part of a command as a content of a string. It looks something like this:
else
{
if (bNumber >= 100 && bNumber <= 864)
{
_itoa_s(bNumber, *buffer3, 3, 10);
bCharNumber = "b" + *buffer3[0] + *buffer3[1] + *buffer3[2];
}
}
}
(&bCharNumber).a1.n1 += 1; <=== syntax error is here.
The syntax error says that this expression must be a class, structure or enum. Well, it is a structure!
The only alternative as I see now is to write a switch, and it will be a nested switch,, but it will be enormous with 864 options and 90 suboptions. Any other ideas?
Thank you, - MyCatAlex
Continue reading...