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...

You have replaced a laptop battery. What should you do with the replaced laptop battery?

A) Give it to the customer. B) Throw it in the waste basket at the customer site. C) Determine the local city/state guidelines for battery disposal. D) Turn in to the city recycling center.

Computer Science & Information Technology

Which of the following items changes the encryption key on a users session after a set period of time?

A. TKIP B. AES C. RADIUS D. WEP

Computer Science & Information Technology