And I also know that allocating memory is also an important factorBy the way, the pointer thing is one of the most inportant functionalities in C and C++.
| |
|
Welcome to AstaHost - Dear Guest | |
Replying to C++: Basic Classes
Topic Summary
vistz
Posted 25 October 2010 - 11:16 PM
yordan
Posted 29 September 2010 - 08:58 AM
By the way, the pointer thing is one of the most inportant functionalities in C and C++.Of course, there's the addition of pointers that I have to worry about also.
vistz
Posted 28 September 2010 - 03:50 PM
Posted 11 December 2009 - 12:28 PM
Posted 17 May 2009 - 05:40 PM
Thanks u very much ^^. Your notes are very useful for me. I wish all Learn programming books had clear ideals like yours. You make me to love C++ so more!
-reply by Thang Doan MinhGr33nN1nj4
Posted 11 August 2008 - 06:02 AM
Access private member function without using friend class
C++: Basic Classes
I want to use private member function in other class , how can I access without using friend.
-question by Aijaz Ahmad
You can't as that is the idea behind private functions/variables, think of them as globals but only for that class. What you could do(assuming you have access to the source) is create a public "proxy" function think simply passes the given variables to the private function. For private variables I would recommend implanting get/set functions.
example of a get/set
class MyClass
{
public:
MyClass() // :) never forget to initialize your values.. bad things will happen if you don't
{
number = 0;
}
virtual int get_number() // Returns the value of the private member number
{
return number;
}
virtual void set_number(int value) // Sets number to equal value
{
number = value;
}
private:
int number;
};Posted 09 May 2008 - 07:58 AM
C++: Basic Classes
I want to use private member function in other class , how can I access without using friend.
-question by Aijaz Ahmad
Posted 30 January 2008 - 01:15 PM
Very simple illustrations...!
-venkatraman.S
qwijibow
Posted 28 February 2007 - 01:36 PM
class
{
};
quinciest
Posted 01 February 2007 - 04:57 AM
although i've read it in book
but i more understand read this one



