So, I have a program where I have to work with multiple arrays and other variables which leads to ALOT of variable declerations and innitializations, re-innitializations etc.. (all seperate) but they all have so much in common, basically the same over and over again with different names and different sizes (i.e. arrays).
So i wanted to clean things up, create a single structure with a set of variables grouped together (integers, arrays, whatever), dynamically allocate memory for it on runtime depending on what I need, create multiple instances of it if need be. But i'm curious if i'm generating tons of data if I should just be going the long route and doing the painstaking "setup" in my program as opposed to the generic less coded dynamic way. I don't notice much speed difference (believe me I am generating lots of data), but I believe in the future I could be generating 2, 3, 4 times as much and maybe than ill see a speed difference?
So I guess what i'm asking is if I absolutely don't need to have dynamic memory allocation, should I be doing it? i guess i found it more appealing because of the time and effort it saves me....It runs smoothly as well, proper allocation and de-allocation, no memory leaks etc..And it's also not alot, an array and a few integers grouped together under a structure.
But, a program running for 5 minutes where this snippet of code is run possibly hundreds of thousands of times can add up I guess.....i mean ive done it both ways and didnt notice it too much. Speed is really only an issue if its bogged down like crazy, so allocation and deallocation happens alot