Computer Science, asked by shabbirduaa, 1 year ago

what is difference between classes and functions in c++ programming

Answers

Answered by chocku
1
class are primary entities in c++ programming. classes contain both objects and functions inside it. function should be declared inside the class and can be defined outside using scope resolution . but functions does not contains class within it.
Answered by lucky091
1
C++ is an object oriented language that mainly focuses on objects. A class in C++ can be defined as a collection of related variables and functions encapsulated in a single structure. Instances of the class are termed as objects. A structure in C++ can be referred to as an user defined data type possessing its own operations. Unlike in the C language, they both are quite similar in C++. The main difference that exists between them is regarding the access modifier; the members of a class are private by default, whereas members of a struct are public by default. 




Attachments:
Similar questions