Robert Ryan wrote:
> the problem states: allocate an int in C++, initialize it to 7 and assign it 
> to a variable p1
>                                 print out the value of p1 and of the ints it 
> points to
<snip>

So...probably something like this:


int *p1 = new int(7);

cout << p1 << ", " << *p1 << endl;

delete p1;


IMO, wrong approach to teaching.  new/delete should NEVER appear in the 
application layer.  Additionally, this is a fairly pointless exercise.

-- 
Thomas Hruska
CubicleSoft President
Ph: 517-803-4197

*NEW* MyTaskFocus 1.1
Get on task.  Stay on task.

http://www.CubicleSoft.com/MyTaskFocus/

Reply via email to