Answer to Question #224816 in C++ for snr

Question #224816

how to add a behaviour to modify details and display them in c++


1
Expert's answer
2021-08-10T11:52:00-0400

Behaviors are used to modify the value of class member variables. Behaviors can be seen as the functions that can access the private members of a class.

For instance, the below class has a set function to initialize and get function to return the value of the variable.

class VariableInt{
private:
int x ;
public:
void setX(int x)
{ 
x = a;
}
int getA()
{
 return a; 
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS