You cannot invoke external program functions directly if that's what you mean. In order for two program to communicate with each other you need some kind of marshalling system. Since the only entry point that is directly available is your main function you could use command line switches to invoke specific functions in your program, but you cannot return anything useful to the calling program other than an integer. The other downside is that you must load and unload your program with each call. If that is adequate for your needs then its certainly a solution, albeit an elegant one.
A better approach is to make use of your operating system's message queue. This allows two separate programs to communicate with each other through their own message handlers. Thus program A can post a message instructing program B to invoke a certain function and the function can post a message back to program A with the result of that function. Of course both programs must be running, but there's nothing to stop program A from invoking program B with a command line switch containing program A's process ID, thus allowing program B to post a message to program A when it is ready to receive messages.
Of course an altogether better approach would be to place all the shared functions in a dynamically linked library that either program can load and call just as if those functions were statically linked within the program itself. If the programs themselves need to communicate with each other, message queues can be used for that purpose, but shared functionality should be kept entirely separate wherever possible.
Every C plus plus program that is a main program must have the function 'main'.
It is the first function that gets called when the program is executed.
...a function call.
method
If you declare a variable inside of any fuction (except main) it will not be available to other functions.
There is no such thing. You probably meant the main function. The main function is the only function that is required as it serves as the entry point of the program.
It is DOS-specific function in TurboC to call an interrupt. See the built-in help.
Anything declared outside of a function is global.
Functions are very important in C++, as you can't write the simplest program to print hello without using a function. Overall you can say that function are building blocks of a C++ program. Functions can also be defined by the programmer to reduce program size.
I don't think its possible. Every C++ program must at least have the main function.
No. A branch is akin to a goto statement in procedural programming. The code branches off to a new code segment, never to return. A function call is akin to a subroutine in structured programming. When the subroutine is finished, control is returned to the instruction immediately following the function call, just as if the function's code were inline expanded at the call site.
The format of a basic C++ program is as follows: First, you have your include statements. Next, you have your function prototypes, and class declarations. Then, you have your main function. This can be organized into small parts using whitespace characters. Finally, you have the definition of all the functions you call in the main function. Really, it's up to the individual programmer how most of the code is organized, but the above is a good structure if you're not absolutely sure what you're doing.