mahesh said:
Can anyone direct me to the place where i find the solution for the
error message "cannot call member function 'X' without object"???
thanks in advance
Yes, try
http://www.parashift.com/c++-faq-lite/how-to-post.html#faq-5.8
However, the error is fairly clear. You are trying to call a member
function X. You must have an object to call X on, e.g.
either
T obj;
obj.X();
or
T *obj = new T;
obj->X();
Since I doubt that you are making a T::X() call directly in your code, I
suspect you have a static member function in T, and are trying to call
X() from within it. Won't work. A static member function doesn't have
a this pointer, so you still need a pointer to, a reference to, or an
actual T object to call X() on.