Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --example.h--
- // empty file
- --example.cpp--
- int add(int x, int y)
- {
- return x + y;
- }
- --main.cpp--
- #include <iostream>
- #include "example.h"
- int add(int x, int y); // forward declaration using function prototype
- int main()
- {
- using namespace std;
- cout << "The sum of 3 and 4 is " << add(3, 4) << endl;
- return 0;
- }
- //works fine under g++
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement