C++ dynamic memory allocation with arrays in a structure
问题 There have been similar questions to this but they are all in C, rather than C++, so I have asked a new question. I have been following a C++ tutorial and after completing the dynamic memory, pointers and structure sections I tried to put them together in an example program. Essentially, I am trying to have a dynamically allocated array of a structure (the program inputs "produce" :P and displays the result). The compiler errors: 'base operand of '->' has non-pointer type 'produce' for the