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

The standard that utilizes text to define the structure of data

a. HTTP b. XML c. XLS

Computer Science & Information Technology

The __________ manages the directory.

a. IOCS b. user interface c. file system d. device management system

Computer Science & Information Technology