Question: 2. a) Why doesn't the code compile? b) What needs to be changed on line 9 to compile the code? Line commenting 9 is not

2. a) Why doesn't the code compile? b) What needs to be changed on line 9 to compile the code? Line commenting 9 is not allowed and change must be the smallest possible! (C++)

1 #include 2

3 class Token {}; 4

5 int main() { 6 std::vector v; 7 v.push_back(new Token); 8

9 Token* t = v.begin(); 10 11 delete t; 12 return 0; 13 }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!