T
The Cool Giraffe
I got a hint recently (guess where, hehe) and was directly
pointed to the vector class. Now, i have no issues using
that way but i'm concerned about the performance issue.
Which is fastest (significantly faster, preferable in any
way, etc.) in the following list.
a) std::vector?
b) a struct with an array and an integer?
struct {int* arr = new arr[m]; int m}
c) saving the int as an instance variable?
int* arr = new arr[m];
this.arrSize = m;
In the program, there will be a lot of looping and iterating
and i'm supposed to use C++, if that's of any importance to
answer the abc-questions.
pointed to the vector class. Now, i have no issues using
that way but i'm concerned about the performance issue.
Which is fastest (significantly faster, preferable in any
way, etc.) in the following list.
a) std::vector?
b) a struct with an array and an integer?
struct {int* arr = new arr[m]; int m}
c) saving the int as an instance variable?
int* arr = new arr[m];
this.arrSize = m;
In the program, there will be a lot of looping and iterating
and i'm supposed to use C++, if that's of any importance to
answer the abc-questions.