The correct terminology is member variables and member methods. They are both members of a class. The member variables are used to store an object's data, while the member methods are used to operate upon that data.
Either make the data members public, or make the member function a friend of the class containing the data member.
Public data members are akin to structure data members (which are public by default). Since they are public, they are fully exposed outside of the class. Data validation becomes impossible. Even if you define an interface, there's no requirement to use it since the members are readily available. If the members must be validated, do not assign them public access.
Base class members before local members.
Only that they cannot be inherited by derived classes. This is "a good thing". Other than that, a friend function has full access to a class' private and protected members and you cannot limit its scope. At this data hiding feature of c++ is broken.
first write main function and what are the use classes which type you want then give the data members to the member functions finally you will terminate the program
Either make the data members public, or make the member function a friend of the class containing the data member.
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.
False. Variables declared within a particular member function are local to that function, and are automatically allocated and deallocated at entry and exit of the function.
In C++, a friend function or friend class can grant access to its private data members to other classes. The public member allows any class to access that data.
Prototype of function describes return value as well as which data can be passed to the function.
the computer function processed data is displayed is known as...
function of the processor is to process data
the function of a cd is to store data
the function of a cd is to store data
Public data members are akin to structure data members (which are public by default). Since they are public, they are fully exposed outside of the class. Data validation becomes impossible. Even if you define an interface, there's no requirement to use it since the members are readily available. If the members must be validated, do not assign them public access.
function of the processor is to process data
The input function is the computer function where raw data is received. This is done via an input device such as a keyboard and mouse.