Hi guys, i made the following code for the class product. In main body i tried to create an array of pointer for the member name but the compiler shows me error.. Any ideas?
there is a misunderstanding, that i upload is only a sension from my program my question is focus on between the lines 8 to 13 cause i dont know how to create a table of pointers and that i made is from internet sources.
Line 9 is the problem. There is no variable name and no size specified for the new array. The types don't match either and the fields in the given class are private.
I'll assume your members are public and that you have a default/no parameter constructor.
This should get you going the right direction:
1 2 3
*product[100];
product[0] = new product;
product[0]->code = "myCode";
PS: it is best not to edit a post after it was replied to. Others with the same issue will find the solution without having to ask the same question again.