HACKER Q&A
📣 _448

What are some funny ways a programming language feature is explained?


In C++ a class can have access specifiers 'public', 'protected' and 'private'. The functions and variables defined under the 'private' section of the class is not accessible to anything outside that class. But there is a feature of the language that makes it possible for a class to specify which other external class or function can access the class' private functions and variables. This feature is called 'friend'. So if a class declares that some other class or function is a friend, then that external class or function is able to access the functions and variables defined under the private section.

To help explain this language feature to newcomers to C++, and help them remember this, a very funny statement is used; and it goes something like this: "Only friends can access/see your private parts".

What other language features are explained in a funny way?


  👤 chrism238 Accepted Answer ✓
I heard that as "Only friends can access/see your private members”.