What is the difference between a local variable and a data member?

What will be an ideal response?


A local variable is declared in the body of a function and can be used only from the point at which it’s declared to the closing brace of the block in which it’s declared. A data member is declared in a class, but not in the body of any of the class’s member functions. Every object of a class has a separate copy of the class’s data members. Data members are accessible to all member functions of the class.

Computer Science & Information Technology

You might also like to view...

MC There is a________relationship between a primary key and its corresponding foreign key.

a) many-to-many. b) one-to-one. c) one-to-many. d) None of the above.

Computer Science & Information Technology

When wrapping text in a cell, row height increases and decreases automatically

Indicate whether the statement is true or false

Computer Science & Information Technology

Parental controls can be applied to a guest account

Indicate whether the statement is true or false

Computer Science & Information Technology

The ____ is a storage location for bitmaps and other objects used in a document.

A. vault B. picture portal C. clipboard D. library

Computer Science & Information Technology