some more
This commit is contained in:
23
OOP/class_methode_outside.cpp
Normal file
23
OOP/class_methode_outside.cpp
Normal file
@@ -0,0 +1,23 @@
|
||||
#include <iostream>
|
||||
|
||||
/*
|
||||
Here we have a Class which has a Function that is declared outside of the Class itself ;
|
||||
We just reference the Function inside the class and later outside create a Function with this structure:
|
||||
class::function()
|
||||
*/
|
||||
|
||||
using namespace std;
|
||||
|
||||
class outside {
|
||||
public:
|
||||
void coolFunc();
|
||||
};
|
||||
|
||||
void outside::coolFunc() {
|
||||
cout << "I am a cool Outside Function\n";
|
||||
};
|
||||
|
||||
int main() {
|
||||
outside classobj;
|
||||
classobj.coolFunc(); // No cout needed here for some reason ; idk why
|
||||
}
|
||||
Reference in New Issue
Block a user