I have constructed a struct in a C++ class,
Lets sat it is called Task
I would like to initiate a new constructed based on an index that might change every time I run the program, for example
for ( i=1; i<=index,++i){
Task ai;
}
this way after the loop I would like to have structures named a1, a2, a3 ,a4,…an
How can I add the number i to the end of the name as a part of it.
As mentioned you could use an
std::vector<Task>, although I would probably just use a dynamically allocated array: