Blog

C++ Classes

In object oriented programming, classes are data structures that are able to perform, or do stuff with the information it holds. These classes can be structured so that it’s properties and behavior are available to other classes or only itself. These and other features of object oriented programming make C++ a language suitable for large projects which need the coordination of several programmers and the modularization of tasks.

An example of a class is a shape class. A class called triangle, for example, can be a class which holds the properties of a triangle. Then the class can calculate the area of the described triangle through class functions, also called methods. These are declared within the class definition and defined later on the program.

Get Involved

Legal

nanoHUB.org, a resource for nanoscience and nanotechnology, is supported by the National Science Foundation and other funding agencies. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation.