sample* ptr=new sample;
ptr->value = 5;
ptr->p = 'c';
cout<<"address of ptr "<<&ptr<<endl;
Program doesn't give segmentation fault but I am not sure whether the method I have used is right. Also, I assume the pointer location of ptr is stored in first 4 or 8 (for 64 bits) bytes of "arr".
If the method is right, then
1. How do I make sure the values are correctly copied? I mean how do I print out the actual values?
2. While retrieving data from the timer class, how I do get it back? Using same method, that is, find the pointer location first and then values or something else needs to be done?