Jump to content


Check out our Community Blogs

Siten0308

Member Since 18 Jun 2008
Offline Last Active Aug 03 2018 06:53 PM
-----

Posts I've Made

In Topic: C++ pointers, references and Dynamic Memory... oh my :(

03 August 2018 - 06:52 PM

Hello CC Addict, big thanks for taking the time to explain, so the biggest thing is performance for using pointers, let me know if this makes sense (i have been watching videos and reading forums about pointers and smart pointers etc. but still trying to get smart pointers so bare with me :( )

 

so i would use a pointer to probably store a large object/variable? then i would want to have it hold a lot of memory for it for performance purposes, especially if its going to be multiple same objects/variables, so i would declare a pointer like:

 

double * buffer = new double[8] which means 8 bytes for a double * by 8 = 64 bytes (correct?)

 

so i can store multiple double variables within the buffer object/variable? (would my example buffer be a variable or would it be a object?)

 

so let me know if that makes sense to you in a real world scenario, if not, let me know what is a good example in a real world scenario, again big thanks for taking the time to read and write to my post :)


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download