Even your explanation is not good enough to answer your question, from my guess I think you are trying to use non-static class member in static function. That compiler won't allow you to do like this. Because static members are independent of class objects, means those are common to all objects of that class. But, non-static is dependent of class objects. Trying to Access non-static member from static function is like breaking integrity of the class objects. So, please try to understand what you are trying or post questions clearly to get answered.