Re: Array of objects
Why not use std::string?

Originally Posted by
Aashi
yep sure it would be like this:
I think you quoted more than what you intended because you didn't fix the unsafe practice of calling delete by hand which can be fixed with raii design at the least, but that is ok.
Code:
Stock *s1=new Stock[2];
should be
Code:
unique_ptr< Stock [] >s1( new Stock[2] );
which can also be
Code:
vector< Stock >s1( 2 );
or even just
Last edited by Joeman; November 8th, 2011 at 03:28 AM.
0100 0111 0110 1111 0110 0100 0010 0000 0110 1001 0111 0011 0010 0000 0110 0110 0110 1111 0111 0010
0110 0101 0111 0110 0110 0101 0111 0010 0010 0001 0010 0001 0000 0000 0000 0000 0000 0000 0000 0000