placing void() in a 2nd source file

HI,

im trying to create a program that contains a void() function which is in a second source file.

Its supposed to look like this:

File 1:
1
2
3
4
5
...
int main()
{ 
test1();
}

File 2:
1
2
3
4
void test1()
{
cout << "Hello World" << endl;
}


My question is how to I do that? And where do I put the #include files?

Thanks in advance ! :)
Try to see if this article helps you: http://www.cplusplus.com/forum/articles/10627/

short explanation:
Put the prototype for test1 in a header file
#include that header in both source files
compile and link the two source files
Topic archived. No new replies allowed.