Find any errors in the following and explain how to correct them:

```
string& foo() {
string s("Hello");
... // other statements
return;
}
```

A value is not being returned from the function (i.e., the return statement should be return s;). The return type should be string not string&—reference returns are dangerous.

Computer Science & Information Technology

You might also like to view...

Describe a general plan of action for initiating a security policy, elaborating on each stage that might be undertaken.

What will be an ideal response?

Computer Science & Information Technology

When a VB application executes, its __________ is automatically displayed.

a. main sub b. startup form c. event procedure d. form load event

Computer Science & Information Technology