Which of the following expressions is legal? Treat the effect of these as non-cumulative.

Suppose we have the following definition:
```
vector vec, vec1;
//use push_back to put 10 values into vec instead
vector::iterator p = vec.begin();
vector::const_iterator q = vec.begin();
```

a) *p = 1;
b) *q = 1;
c) p = vec.end ();
d) q = vec1.end();


All are legal except b).

Declaring q a const_iterator promises not to change the location in the vector that q points using q. The error message a compiler gives for part b) is
```
// *q = 1; error: l-value specifies a const object
```

Computer Science & Information Technology

You might also like to view...

What problems do you think might arise in extreme programming teams where many management decisions are devolved to the team members?

What will be an ideal response?

Computer Science & Information Technology

What is required to make email flow properly to the cloud?

What will be an ideal response?

Computer Science & Information Technology

Each TextField has a text property that’s returned by its textProperty method as a StringProperty. The StringProperty method ________ receives an ObservableValue as an argument. When the ObservableValue changes, the bound property is updated accordingly.

a. tie b. join c. attach d. bind

Computer Science & Information Technology

The ____ directive tells Apache which filter (allow or deny) should be run first.

A. ServerName B. NameVirtualHost C. ServerAlias D. Order

Computer Science & Information Technology