Never heard the word hyperlink being used for anything other than web links before.
It looks like you want to call a function. The function can be defined in another source file but you still need the function declaration before you can call it.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
// main.cpp
// This is a declaration of the foo function.
// It's necessary because we need to tell the compiler about
// the function before we can call it in this source file.
void foo();
int main()
{
if(condition==true){
// Calls the foo() function.
foo();
cout<<"Please wait";
}
}
1 2 3 4 5 6 7
// foo.cpp
// Here is the definition of the foo() function.
void foo()
{
cout<<"I'm doing something...\n";
}
Often function declarations are put into header files. So if we have file foo.cpp it is common to have a file foo.h that we can include to use the functions in foo.cpp.
1 2 3
// foo.h
void foo();
1 2 3 4 5 6 7 8 9 10 11 12 13 14
// main.cpp
#include "foo.h"
int main()
{
if(condition==true){
// Calls the foo() function.
foo();
cout<<"Please wait";
}
}
The benefits of structuring the code like this becomes more apparent when you have many functions in the same file and many other files that includes them.