Could anyone offer any insight here please? I have a complete working program with the parameters for use hard-coded in. This program is 'encapuslated' if you will, within a control loop.
yesterday i added a function call before the main loop starts so that the user can input the run parameters themselves. the function calls are in a switch block and the function body is written after the end of main.
the function uses scanf to read five integer parameters into the program.
I tested their values after the switch block and they are correct as inputted.
However my problem is that now when i allow the program to go on and start its loop the output results are different than if i had left the values hard coded.
I have tested this with known data and the results are well out,
If i comment out the additional function, the results return to normal.
I have heard that scanf is pants?? i am pretty certain the code is ok, so could it be my choice of input reading that is letting the side down.??
As i say, once the program loop starts the values input are static. so i cant figure it out!