c++ Programming Glossary: myptr
size of a pointer http://stackoverflow.com/questions/6751749/size-of-a-pointer always have a fixed size For example... int x 10 int myPtr x char y 'a' char myPtr2 y std cout sizeof x n std cout sizeof.. size For example... int x 10 int myPtr x char y 'a' char myPtr2 y std cout sizeof x n std cout sizeof myPtr n std cout sizeof.. y 'a' char myPtr2 y std cout sizeof x n std cout sizeof myPtr n std cout sizeof y n std cout sizeof myPtr2 n What would the..
Differences between unique_ptr and shared_ptr [duplicate] http://stackoverflow.com/questions/6876751/differences-between-unique-ptr-and-shared-ptr time error. For example this code is illegal unique_ptr T myPtr new T Okay unique_ptr T myOtherPtr myPtr Error Can't copy unique_ptr.. unique_ptr T myPtr new T Okay unique_ptr T myOtherPtr myPtr Error Can't copy unique_ptr However unique_ptr can be moved.. can be moved using the new move semantics unique_ptr T myPtr new T Okay unique_ptr T myOtherPtr std move myPtr Okay resource..
cudaMemcpy segmentation fault http://stackoverflow.com/questions/15431365/cudamemcpy-segmentation-fault I have a class like this class myclass int myval int myptr I could instantiate the above class on the host and then malloc.. and then malloc an array of int and assign that pointer to myptr and everything would be fine. To make this class usable on the.. device use malloc or new to allocate device storage for myptr The above sequence is fine if I never want to access the storage..
|