C++ Tutorial 13

+1 Alekro A · August 15, 2014
I am quite new to this so can somebody explain to me why its not good to write public variables in classes?

Post a Reply

Replies

Oldest  Newest  Rating
0 Orvin Welchez · August 15, 2014
I'm also pretty new to this but I'll throw my two cents, I'm assuming that when you make public variables, they can be easily modified pretty much by anything and private are kinda dummy proof and there has to be a more complex way of accessing them, making them more secure.
0 Alekro A · August 16, 2014
So what you mean is that if you make an bigger application the public functions can mess with main while a private function is more secure?
0 Alekro A · August 16, 2014
So it works kind of like a reminder that gives you error when you write somthing that should not have been wrote?
  • 1

C++

122,610 followers
About

Used in many types of software including music players, video games, and many large scale applications.

Links
Moderators
Bucky Roberts Administrator