Skip to main content

16 docs tagged with "cpp"

View All Tags

Enums

Just like in C you can use normal enums and they work the same way.

Inheritance

Works very similar to other programming languages like Java where you have super/parent classes and sub/child classes and the child inherits the attributes and functions of the parent.

Move Semantic

When working with big objects for example an Image copying objects around can get very expensive. For example if create a factory function

Overloading

C++ allows you to specify more than one definition for a function name or an operator in the same scope, which is called function overloading and operator overloading.

Strings

Along with the C way of using strings as character arrays there are many other new things in C++.

Structures

Just like in C you have structs which are also commonly called open classes. Structs can only hold public attributes and no functions.

Templates

Templates are the C++ version of Java's generics. Just like with Java generics you can write generic code (a template) that is not dependent on a type.

Union

In a union all members share the same memory location. This means that at any given time, a union can contain no more than one object from its list of members. It also means that no matter how many members a union has, it always uses only enough memory to store the largest member.

Variables

In C++ you pretty much have the same data types as in C and they work the same as C++ in an extension of C. If you want specific sized data types you can just as in C include from the standard library cstdint.h.