A public member isn’t global if it isn’t also static, for access to a (non static) public member you need to create an object of that class so that don’t break the concept of encapsulation.
More Related Contents:
- What is the difference between public, private, and protected inheritance in C++?
- When should you use ‘friend’ in C++?
- Can I access private members from outside the class without using friends?
- Effective C++ Item 23 Prefer non-member non-friend functions to member functions
- How to access private data members outside the class without making “friend”s? [duplicate]
- accessing a protected member of a base class in another subclass
- Dynamic memory allocation in game server [closed]
- Does the stream operator exist for class member functions?
- What platforms have something other than 8-bit char?
- What is memory fragmentation?
- Code outside functions
- undefined reference to boost::system::system_category() when compiling
- Is the order of iterating through std::map known (and guaranteed by the standard)?
- What is the difference between “new” and “malloc” and “calloc” in C++? [duplicate]
- boost::spirit::qi duplicate parsing on the output
- Error LNK1104: cannot open file ‘Debug\MyProjectLib.lib’
- Compile-time assertion?
- updating a string table with UpdateResource
- C++11: Compile-time Array with Logarithmic Evaluation Depth
- Image scaling and rotating in C/C++
- static vs non-static variables in namespace
- How is vector implemented in C++
- Specify template parameters at runtime
- linker error while linking boost log tutorial (undefined references)
- How to validate numeric input in C++
- How does #include work in C++?
- Difference between const. pointer and reference?
- C++ range/xrange equivalent in STL or boost?
- Reading json file with boost
- How to write an object to file in C++