Skip to content

Abensett/16.CPP-Module-04

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

16.CPP-Module-04

  • Polymorphisme par sous-typage
  • Classes abstraites
  • Interfaces

Polymorphisme par sous-typage

virtual devant fonction membre ->  méthode = sa résolution devient dynamique

Compilation :

Process of source code files (.c or .cpp) and the creation of an 'object' file. This step doesn't create anything the user can actually run.

Linking :

Linking refers to the creation of a single executable file from multiple object files. In this step, it is common that the linker will complain about undefined functions. During compilation, if the compiler could not find the definition for a particular function, it would just assume that the function was defined in another file.

TO_STRING version sstream c++98 codée dans brain.cpp

Use of a virtual destructor

When a pointer object of the base class is deleted that points to the derived class, only the parent class destructor is called due to the early bind by the compiler. In this way, it skips calling the derived class' destructor, which leads to memory leaks issue in the program.

Abstract Classes

  • Non instanciable
  • All the non implemented member functions have to be implemented in the derived/inherited class

Interfaces

  • Abstract class in which all the member functions are not implemented

Releases

No releases published

Packages

No packages published