Last active
September 18, 2018 18:27
-
-
Save tinvaan/fa6e76a8c28836da1afe83be4f7b0659 to your computer and use it in GitHub Desktop.
C++ headers and source description
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
class Foo | |
{ | |
public: | |
Foo() {} | |
void method1() | |
{ | |
std::cout << "Foo::method1()" << std::endl; | |
} | |
void method2() | |
{ | |
std::cout << "Foo::method2()" << std::endl; | |
} | |
}; | |
int main(int argc, char *argv[]) | |
{ | |
Foo f; | |
f.method1(); | |
f.method2(); | |
return 0; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
class Foo | |
{ | |
public: | |
Foo(); | |
void method1(); | |
void method2(); | |
}; | |
Foo::Foo() | |
{} | |
void Foo::method1() | |
{ | |
std::cout << "Foo::method1()" << std::endl; | |
} | |
void Foo::method2() | |
{ | |
std::cout << "Foo::method2()" << std::endl; | |
} | |
int main(int argc, char *argv[]) | |
{ | |
Foo f; | |
f.method1(); | |
f.method2(); | |
return 0; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include "foo.h" | |
Foo::Foo() | |
{} | |
void Foo::method1() | |
{ | |
std::cout << "Foo::method1()" << std::endl; | |
} | |
void Foo::method2() | |
{ | |
std::cout << "Foo::method2()" << std::endl; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
class Foo | |
{ | |
public: | |
Foo(); | |
void method1(); | |
void method2(); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "foo.h" | |
int main(int argc, char *argv[]) | |
{ | |
Foo f; | |
f.method1(); | |
f.method2(); | |
return 0; | |
} | |
/** | |
* Program to be compiled using | |
* $ g++ main.cpp foo.cpp | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment