What is member function and what is an example of non-member function? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

What is member function and what is an example of non-member function?

27th Dec 2016, 8:15 AM
Ka Yip
1 Resposta
+ 1
Non-member functions are declared outside any class (C++ calls this "at namespace scope"). When declaring a member function, you need to do so in the class of which it is a member: class Class { public: void a_public_member_function(); };
27th Dec 2016, 1:10 PM
Romas Kontrimas
Romas Kontrimas - avatar