Convenience. C and C++ are both 'complete languages'. You can do anything in one that you can do in another.
However, classes provide a simple and compiler-assisted way of dealing with inheritance, polymorphism, information hiding, and access protection, among other things. These are all implementable in C, but you have to do a lot of the grunge work yourself.
If you don't know what these things are, I suggest you pick up a book on C++. You're right. You could write a program entirely without classes, or in fact without any C++ extension to the C language. Classes just come down to a language-supported convenience.
Comments
Convenience. C and C++ are both 'complete languages'. You can do anything in one that you can do in another.
However, classes provide a simple and compiler-assisted way of dealing with inheritance, polymorphism, information hiding, and access protection, among other things. These are all implementable in C, but you have to do a lot of the grunge work yourself.
If you don't know what these things are, I suggest you pick up a book on C++. You're right. You could write a program entirely without classes, or in fact without any C++ extension to the C language. Classes just come down to a language-supported convenience.