Thanks all!!!
First of all, it was said, make an array of OBJECTS!!!
But, kill me if I am aware what is that ment to be!!!
I have 3 objects, toy, book and dress.
If I put array[0] = toy, what do I get when I write:
,
cout<<array[0];?
P.s. As far as I understood structures ( I mean structures as structures, not structures as classes!) then I can get & of an object, but value on that & is just the value of its first element, isnt't it?
(Is the element=member treated in that sequence I put them one after another at alll???
Object is an instance of class/structure. So by declaring product array[3] you're creating array of objects.
what do I get when I write:
cout<<array[0];?
Compilation error, unless you define operator<< for ostream and product class.
I can get & of an object, but value on that & is just the value of its first element, isnt't it?
(Is the element=member treated in that sequence I put them one after another at alll???
It depends. On if your class is POD or not, on inheritance, on your compiler and other things.