You are here:

C++/What kind of variables and functions should be public, or private?

Advertisement


Question
Hi, Merry Christmas!

What kind of variables and functions should be public, or private?

Thanks,
lzzzz

Answer
Merry Christmas,
functions that could be used as API (user use them) should be public while the functions that deal with intricate details should be private.

Almost all variables should be private unless and until some very special need arises.

Regards,
RaiD

C++

All Answers


Answers by Expert:


Ask Experts

Volunteer


Dharmender Rai

Expertise

I can answer general and system level C/C++ questions.

Experience

I have 5 years of experience in C++.

©2016 About.com. All rights reserved.