add forward declaration examples
add class & inheritance examples
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
#include "functions.h"
|
||||
|
||||
void functionB() {} // declared & defined
|
||||
void functionC(); // declare
|
||||
void functionD(); // foward declare
|
||||
|
||||
int main()
|
||||
{
|
||||
//functionA(); // compiler error, because function is declared & defined after this call
|
||||
functionB(); // no error
|
||||
//functionC(); // linker error, because function is declared, but not defined
|
||||
functionD();
|
||||
functionE();
|
||||
//functionF(); // linker error, because header file was included multiple times with a definition
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void functionA() {} // declare & defined
|
||||
|
||||
void functionD() {} // definition
|
||||
Reference in New Issue
Block a user