Given these definitions what (if anything) is wrong with the following?
```
int b[5] = {3,4,5,6,7};
for (int j = 1; j <= 5; j++)
tripler(b[j]);
```
Consider the following function definition:
```
void tripler(int& n)
{
n = 3*n;
}
```
a) Nothing is wrong with either bit of code.
b) There are not enough initializers for the array.
c) There is an illegal index in the loop.
d) There are too many initializers in for the array.
e) The call to the function requires different syntax
d) There are too many initializers in for the array., and c) There is an illegal index in the loop.
There is nothing wrong with the array declaration and initialization. However, the loop has both an illegal index (5) and very likely an intent error. The loop runs 1 through 5 instead of the C++ idiom 0 through size-1.
You might also like to view...
Viewing a PowerPoint presentation on a computer system that does not have PowerPoint software requires all of the following EXCEPT ________
A) Microsoft Office 2010 B) PowerPoint Viewer C) the Windows operating system D) the PowerPoint presentation
To access the Edit Relationships dialog box from a shortcut menu, ____ the join line between tables.
A. click and drag B. delete C. left-click D. right-click
Answer the following statement(s) true (T) or false (F)
The Wireless Personal Area Network (WPAN) is defined in the 802.15 standard.
This data encryption standard is the weakest of the wireless encryption standards, with many problems, including encryption that is easy to break; it only encrypts the Data Link and Physical layers, the key is static and shared, and there is no mechanism for performing user authentication.
A. Wired Equivalent Privacy (WEP) B. Mac address filtering C. Wi-Fi Protected Access (WPA) D. Wi-Fi Protected Access 2 (WPA2)