Thursday, July 9, 2009

C++ programming?

display(), setdata(), getdata(), putdata(),setvalu(),why we use this three , if we use what we get by this three functions , what these 5 function do,if i won't use this 5functions could we do the program could someone explain briefly and i have to use this function in order or in method or anywhere in the program plz thankyou

C++ programming?
Your question really does not make any sense. Those functions you describe are not a part of the C++ language, or any standard libraries that I know of. It sounds like you are working on a computer program for some sort of school project, and the program is required to use some basic object-oriented programming techniques. Basically, you implement some sort of functionality inside a C++ object, and you interact with the object by using those member functions you listed. Lets say you are creating an object to represent a person... a person has a name, and a person is generally visible by others. Once the object is designed (the object's design is called a class), you can make the objects in your code, and interact with them...





Person employee; // create a person object


employee.setName("Fred"); // set the person's name


employee.display(); // draw the person on the computer screen





Those functions do whatever you (the programmer) want them to do.





Based on how your question asked for a brief explanation for something that is actually quite complicated, I would highly recommend talking to your teacher about these concepts... and if this is for a grade, hiring a tutor.
Reply:i think u are trying to use the concept of classes in ur program..


u may be familiar that the private members of a class cannot be accessed directly... like class name.data1;


instead u would need a public function to access the private members...


display(),setdata()... etc are probably the functions u would use to access the Private members...
Reply:These function are not part of library function these are user defined function which are declared in a class. Function name is not so important , Important is what code u have written in function each function can do the same job if u written same code in all function. No execution order is not necessary as function declared.


Have a nice day.
Reply:It seems you wrongly understood the concept





There is no such functions in c++


Whatever you saw in that name was defined by the programmer so don't confuse with that





Without specify that names you can write your own methods





Try to understand the program completely OK





Happy learning


No comments:

Post a Comment