No. The first post did not say the new[]/delete[] stuff. They were introduced by you. ;)Quote:
Originally Posted by Paul McKenzie
Printable View
No. The first post did not say the new[]/delete[] stuff. They were introduced by you. ;)Quote:
Originally Posted by Paul McKenzie
??Quote:
Originally Posted by dunakl
Regards,Quote:
How to increase memory size when new/delete are used?
Paul McKenzie
hmm..,
Sorry, I still see it is for a general case, not specifically for list of variables.Quote:
Quote:
How to increase memory size when new/delete are used?
;)
And...Quote:
Originally Posted by dunakl
May be you forgot to read this -Quote:
Originally Posted by dunakl
In any case, when you attempt to solve the problem, you will understand the solutions presented above... ;)Quote:
Originally Posted by Funt
What is the difference? Internally, there is no difference. When you call
you are allocating a contiguous block of n sets of T's. When you sayCode:new T[n];
you are allocating a contiguous block of n sets of T.Code:std::vector<T>(n)
The code to std::resize() is roughly equivalent to the code you would need to do with realloc() (by roughly, I mean vector is more efficient, but does the same thing).
Regards,
Paul McKenzie