Here is what I mean, suppose I have code like:
for (int i = 0; i < 1000; i++) {
char* ptr = something;
/*
... use ptr here
*/
}
It seems that char* ptr
gets allocated every time in the loop, making it ineffective?
Is it more effective to write this?
char* ptr = something;
for (int i = 0; i < 1000; i++) {
/*
... use ptr here
*/
}
Please comment on this interesting problem. Thank you!
Thanks, Boda Cydo.