Answer the question
In order to leave comments, you need to log in
How to correctly define a variable with a vector type?
I need to make a vector of game objects that will grow later. Here I declare a vector and its 0 element, but this entry gives an error.
Can you suggest how to write it correctly?
vector<Object> objects[1];
objects[0] = Object("models/tree.png", 600, 1000, 93, 178);
Answer the question
In order to leave comments, you need to log in
// vector<Object> objects[1]; - это что?
vector<Object> objects; // так правильно
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question