c++ - 2D Array of pointers to objects -
I'm trying to be a manager class in which some objects include arrays of pointers, let's call these objects mushrooms Are there.
But I do not know how to get the syntax for expression and once I have declared it, how should I use the indicator. Here are some ways that I thought the announcements should be done.
mushrooms ** mushrooms; Mushrooms * MushroomsAurre [10] [10]; Mushroom Mushroom Aurere [10] [10]; Is any of these valid? What are the differences?
And how would I have to go about mushroom reaching pointers after the 2D array was declared after "right"?
Thanks
post = "itemprop =" text "> sign < An array of array p> It should be very straightforward: Mushroom * Mushrooms around [10] [10]; And how would I go about pointing to the mushroom in a function
if you have defined a local variable Are you talking about and used inside the same function?
Few functions from zero (mushrooms * mushrooms around [10] [10]; Mushroom array [0] [0] = new mushroom ("yours", "logic", "here"); } Or are you talking about defining an array in a function and then using it inside another function?
zero someFunction (mushrooms * (* P) [10]) {p [0] [0] = new mushroom ("yours", "logic", "here"); } Int main () {Mushroom * Mushroom Aurere [10] [10]; someFunction (mushroomArray); }
Comments
Post a Comment