regarding C++ binary

Hi All,
I have one doubt regarding binary...
When I write a c++ program then I comiple it and once my binary is ready and then I run it and provide what console asks and then it displays prcoessed data....Thats it...to use this binary againI have to close this binary and run it again so that I can proceed to use it again....


This is what I do when I write my programs.....but when applications are running in organisation...a binary has to run continuously and do the needful.

Can you please help me here know how that happens?

Hope you understood my query.


Thanks
Prasad
Here is a simple example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include<iostream> 
int main()
{
int n, s; 
char c = 'a'; 
while(true)
{
    std::cout << "Enter an integer: "; 
    std::cin >> n; 
    s = n * n; 
    std::cout << "square of n is: " << n << "\n";
    std::cout << "Do you wish to quit? y/n"; 
    std::cin >> c; 
    if(c == 'y' || c == 'Y')
    {
         break;
    }
}
return 0;
}
Topic archived. No new replies allowed.