Hi,
is there a way to quickly access members of a struct without naming the struct every single time?
here's a code example of what I mean
Now to access some of the structs members I would need to do something like this:Code:struct myStruct { int ia, ib, ic, id, ie, ig; bool bIsItTrue; }
Is there any way I can tell the compliler that all of the following variables refer to the struct, if they match the name of a member of the struct ?Code:doSomethingWithSomeStructMembers(myStruct.ia, myStruct.ie, myStruct.ig, myStruct.bIsItTrue);
What it could look like (this code does not work of course, I wouldn't ask if it did)
I did a search on this topic, but it's really hard to search something if you don't know it's name.Code:with myStruct { doSomethingWithSomeStructMembers(ia, ie, ig, bIsItTrue); }![]()



LinkBack URL
About LinkBacks
)



