Announced or defined? It is important to keep in mind that before using a function, the compiler must know about the prototype of the function, so use #include to make sure that the compiler has access to the prototype. It does not need the actual code for the function, it is mandatory that it becomes important during communication.
So, if you have:
MyFunc.hpp:
int add( int a, int b);
MyFunc.cpp:
int add( int a, int b) { return a + b; }
Then you can use this in another file:
main.cpp
#include <iostream>
Component 10 Sep 18 '10 at 12:38 2010-09-18 12:38
source share