Question: 1. For each of the lines below, indicate whether they would result in an error if CONST_VECTOR is a vector as declared above. Briefly

1. For each of the lines below, indicate whether they would result     

1. For each of the lines below, indicate whether they would result in an error if CONST_VECTOR is a vector as declared above. Briefly justify your answer. (a) (3 points) CONST_VECTOR.push_back (10); 11 (b) (3 points) cout < < "Size afterwards: < < CONST_VECTOR.size() < < endl; 2. (4 points) Write code that invokes function f below, with variable x as its argument. Your answer should appear after the last close curly brace. namespace ns1 { namespace ns2 int x = 7; { } void f(int); } 3. (5 points) Describe what would be printed by the code below or what error would occur. const char* cstr = "0123456"; const char* ptr = &cstr [4]; cout < < ptr [-1] < < ptr < < endl; 1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Answer 4 points Write code that invokes function f below with variable x as its argument Your answer ... View full answer

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 Programming Questions!