Member functions (methods of a class) without creating the objects? | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
+ 4

Member functions (methods of a class) without creating the objects?

In CPP a lot of the manipulators are used without creating an object of the class (e.g:- endl) ....How is it possible?

12th Feb 2018, 4:09 PM
3D CrackerJack
3D CrackerJack - avatar
1 ответ
+ 6
They are declared static so are class wide methods or properties. You only need an instance for non-statics.
12th Feb 2018, 4:25 PM
John Wells
John Wells - avatar