Which of the following are legal definitions with initializations? (Consider each line to be in a different scope so there is no multiple definition of identifiers.)

a) int count = 0, limit = 19;
b) int count(0), limit(19);
c) int count = 0, limit(19);
d) int limit = 19;
e) int namespace(0);


All are legal except part e) int namespace(0); because namespace is a
keyword. Keywords are reserved so may not be used as an identifier.
Explanation: Note parts a), b), and c). Some authors advocate declaring each identifier in
separate definitions on separate lines, though this takes up more lines. Advocates justify
this by asserting increased readability. The instructor must decide this issue.

Computer Science & Information Technology

You might also like to view...

To figure out the value of a series of payments, the payment financial function is better than the future value function

Indicate whether the statement is true or false

Computer Science & Information Technology

________ is an Excel feature that can find and remove hidden properties and personal information from a workbook

Fill in the blank(s) with correct word

Computer Science & Information Technology

ATM transfer speeds range from _______________ to _______________ Mbps and greater.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

The STS-1 signaling level supports ____ frames per second.?

A. ?8000 B. ?16000 C. ?32000 D. ?64000

Computer Science & Information Technology