Q:

Is the following program legal? If not, how might you fix it?

0

Is the following program legal? If not, how might you fix it?

vector<int> ivec;
ivec[0] = 42;

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Not legal. Use `ivec.push_back(42);` instead.

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now