I was doing some exercises in my C++ primer plus and one exercise wanted me to use a dynamic array of structures. The program creates a car catalog. The user inputs how many cars they want to catalog. A for loop then assigns Make and YearMade to the appropriate number of cars and lastly, another for loop displays all the cars.
I think I did everything mostly right except for the syntax for accessing the structures. Visual Studio gives me this error when I mouse over code involving accessing the structures like cin >> catalog[i]->yearmade;
The error is: expression must have pointer type
Would using an array of pointers to structures make the code work? If so, then how would I make the Pointer to array of structures work?