answersLogoWhite

0

A data member belongs to an object of a class whereas local variable belongs to its current scope. A local variable is declared within the body of a function and can be used only from the point at which it is declared to the immediately following closing brace. A data member is declared in a class definition, but not in the body of any of the class member functions. Data members are accessible to all member function of the class.

User Avatar

Wiki User

14y ago

Still curious? Ask our experts.

Chat with our AI personalities

ProfessorProfessor
I will give you the most educated answer.
Chat with Professor
TaigaTaiga
Every great hero faces trials, and you—yes, YOU—are no exception!
Chat with Taiga
RossRoss
Every question is just a happy little opportunity.
Chat with Ross

Add your answer:

Earn +20 pts
Q: What is Difference between local variable and data members or instance variable?
Write your answer...
Submit
Still have questions?
magnify glass
imp