This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: can i use events in C++?



Jonathan Wakely-4 wrote
> On 27 April 2014 21:53, joaquim wrote:
>> i'm trying do 1 thing with C++ that it's kill me :(
>> how can i create a class derived from other, and change the functions
>> outside the class without re-declare them?
>> (for use '::' ouside the main function in these way: void
>> classname::functionname(){//somthing})
> 
> I don't know what you're trying to do, but this isn't the right mailing
> list.


i'm 100% new in these forum....
Moderator: please change the mailing list, if you can.
see these code:


class test
{
     public:
            virtual void printed(){};

};

class a: public test
{
    //void printed(); //i need avoid these line for my big objective
};

void a::printed()
{
    cout << "hello";
}


class b: public test
{
     //void printed(); //i need avoid these line for my big objective
};

void b::printed()
{
    cout << "hello world";
}

these code gives me an error: printed() isn't a 'b' or 'a' class member.
so how can i do something like these in C++?
i have that 2 commented lines, for avoid them.
what you see outside of 'a' and 'b' class is:

ReturnType ClassName::FunctionName(...)




--
View this message in context: http://gcc.1065356.n5.nabble.com/can-i-use-events-in-C-tp1029575p1029856.html
Sent from the gcc - libstdc++ mailing list archive at Nabble.com.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]