Monday, December 03, 2007

callbacks and static member functions

you can not use non-static member functions as callback.
because class member functions have a hidden argument i.e. this pointer
pointing to the object.while for callbacks you need to have a function with exact declaration/signature.So you can't pass 'this' in the callback.
On the other hand Static member functions do not have this pointer as they can be called without making an instance of class.
So if you want to use a CLASS MEMBER FUNCTION for callback.It must be declared as static.


Also static declaration is given inside class definition only,while define the function in cpp you don't give the keyword 'static'.

Labels: ,

Thursday, February 22, 2007

Copy Constructor and referrences

Guys..........
Tomorrow I will be writing about my experiences on Copy constructors and referrences.

Friday, October 13, 2006

why this blog???????

Souds funny righ???
There are already hundreds of online tutors and courses for c++,thyen why this??
So dear friend this is not a tutor.This is somehing which I experience with C++.
I am not able to mantain a notebook of concepts i daily learn as i used to mantain during college days.So they will appear on this blog.
I think this may be helpful to many other engineers and students,who are staring to get
their hands dirty with c++.
anyways......
I dont take a guarantee that concepts appearing here or being explained here
are correct or using them wont be harmful to your project/system in any way..Whatever appears here is how i interpret and understand the language.
So if you are taking any concept from here,be sure to consult it with some expert/books.
And don blame me.
As far as discussion over c++ concepts is concerned you are most welcome with your ideas,suggestions and querrys.
So here i goes......