0
Are classes in c++ like libraries in c?
In classes you write attributes and behaviour of a variable tipe (e.g. library <stdbool.h> in c that allows you to create bool type variables) and you can write functions in classes (e.g. library <stdio.h> that contains printf and scanf functions). Pls tell me if I am wrong
1 Answer
+ 17
Libraries, stored inside header files, consist of classes and functions.
Are classes like libraries? - Not really. Libraries are made up of classes, each for different purposes.
While the concept of libraries and header files are similar in C and C++, libraries in C only contain functions, whereas libraries in C++ may contain both classes and functions.