-
trouble
i wrote program that takes its inputs in three lines.
int main(void)
{value();/*this reads first line*/
pos(); /*reads second line*/
target; /*reads third line*/
}
but i got a proble about this functýons.Becouse the main program completes its execution with asking me the third input line it stops execution.
how can i stop this?
-
Do you mean you want it to keep looping until the user stops it? If so, just put your code inside a while or for loop.
The following will cause an infinite loop, so the user has to kill the program to stop it. It's a bit nasty doing things this way, but it demonstrates the principle nicely.
Code:
x = 1;
while (x == 1)
{
Func1();
Func2();
Func3();
}
Or, do you mean the third function is not executed? You do realise that you have the brackets missing from it:
>target; /*reads third line*/
should be:
>target(); /*reads third line*/