correct me if I'm wrong | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

correct me if I'm wrong

classes are small programs in the main program that will make the program parts and like functions we can use them with input our value to it and tell it which function and what value do we want to run????

8th Oct 2016, 12:11 PM
Ayin GhaziMoradi
2 Answers
+ 3
Classes don't have to be in the main, they can be standalone files in the form of a .cpp file and a .h file. Classes are structures used in C++ in which we can store members, such as variables and functions, along with certain access specifiers for these members (public, protected and private). These members can be accessed with objects. The great thing about classes are concepts like inheritence and polymorphism, which is where C++ shines as an object oriented language.
8th Oct 2016, 3:47 PM
Cohen Creber
Cohen Creber - avatar
0
Not exactly, classes are like a rubric for how every object of that class should be made. They can have variables, functions and even other classes. Every object you declare of a class will have access to the classes public variables and functions
10th Oct 2016, 8:51 PM
anand k n