Could someone explain to me in english what this piece of code does.
Also if you could show equivilant code not using dynamic allocation.
The above seems to be working in my program.Code:int *myPtr = new int;
I previously tried something similar to this and the app kept crashing
I am writing a simple sorting program that uses pointer notation for everything. Meaning I do not want to do this.Code:int *myPtr; cout.... cin>> *( myPtr ); //Store input into the value myPtr points to
Code:int size; int *myPtr; cout<<"Size : "; cin>> size; myPtr = &size;




Reply With Quote
