Memory usage of a C++ program with CLASS and without CLASS

Hi all,

I developing a C++ Program to deal with huge data computation. I am using Pointers to hold the data during computation. Current program i developed without using CLASS.

I would like to ask that will the memory usage will be reduced and computational time will be shortened if I modified my program implementing the CLASS into it ?

Hope can get some suggestions to improve my program.

Thanks.
Classes themselves do not use any more or less memory than not using classes.

Classes themselves also are not necessarily any faster or slower than not using classes.

So the answer to this question:

I would like to ask that will the memory usage will be reduced and computational time will be shortened if I modified my program implementing the CLASS into it ?


Is "no, not necessarily".


Though that may not be the right question to ask. Classes (and RAII/OOP concepts) provide other benefits that don't necessarily make your program run faster or with less memory. Such as:

- Easier to understand code
- More maintainable code
- Virtually eliminate the possibility of memory leaks.
etc
Topic archived. No new replies allowed.