C++ static function | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

C++ static function

As i know, in c++ we can call static function only this way: ClassName::FunctionName(); So why does this code work? https://code.sololearn.com/c1zFZSM0KxMg/?ref=app

28th Sep 2018, 1:00 PM
Anna Simonyan
Anna Simonyan - avatar
3 Respostas
+ 2
is it something new?
28th Sep 2018, 3:06 PM
Anna Simonyan
Anna Simonyan - avatar
+ 1
Static members and methods of a class are shared among all of it's instances. Calling a static method using scope operator relieves you from instantiating an object of the class itself.
28th Sep 2018, 2:56 PM
HoĆ ng Nguyį»…n Văn
HoĆ ng Nguyį»…n Văn - avatar
+ 1
Anna Simonyan no, I suppose not. Definitely, not a new feature from modern C++.
28th Sep 2018, 3:11 PM
HoĆ ng Nguyį»…n Văn
HoĆ ng Nguyį»…n Văn - avatar