Wikipendium

Share on Twitter Create compendium
Languages
  • Norwegian
+
Edit History
Tools
  • Edit
  • History
  • Share on Twitter

  • Read in Norwegian
  • Add language

  • Create new compendium
Log in
Table of Contents
  1. Introduction
  2. Fundemental
    1. Data types
    2. Object structures
      1. Class
      2. Struct
      3. Enum
‹

TDT4102: Procedure and object oriented programming

Tags:
+
Edit

Introduction

C++ is a programming language made by Bjarne Stroustrup with C as a basis. It was first known as C with classes.

Edit

Fundemental

Edit

Data types

Type Size Size
int 32 bit 4 bytes
double 64 bit 8 bytes
float 32 bit 4 bytes
char 8 bit 1 byte

The size of the int type is implementation dependent (at least 16 bits), but is 4 bytes on all modern systems.

Edit

Object structures

Edit

Class

A class is a structure for defining a new object type.

class Car {
    int seats, sylinders, year;
    double engineVolume;
    string make, model;
public:
    void start();
    void stop();
    void accelerate(int dV);
}
Edit

Struct

Edit

Enum

Written by

oyvindrobertsen roessland cristea Ose
Last updated: 11 years ago.
  • Contact
  • Twitter
  • Statistics
  • Report a bug
  • Wikipendium cc-by-sa
Wikipendium is ad-free and costs nothing to use. Please help keep Wikipendium alive by donating today!