recently I am doing a project for a school course. I always declare all variables and methods inside every classes public because It helps me access those variables easier while developing and less coding for the get(); and set(); functions. However, i think this is the wrong way of doing OOP. Any ideas? Source: Windows ..
Category : access-modifiers
I have this string s and t in class. class A { private: static string s; string t; public: void printString() { cout<<s<<t<<endl; } }; I tried printing these string and everytime they were empty if not initialized. So my question is whether a class string is always empty before initialization by a constructor. Also ..
Help me pleaseee. I have a problem with my getters and setters in C++. I implemented a Queue, I also implememented a class Process. My queue saves processes. My class Process has two attributes: "Identifier" and "Time" and also has setters and getters. I set 80 as its Time. The problem then is that I ..
I’m using Visual Studio with Visual Assist. I found if a class gets too big, you have to scroll up to check the access modifiers to know if the method or variable is public, protected, or etc. It takes some time and the access modifier could be missed if you scroll too fast. Is there ..
Recent Comments