LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Some Strange behavior

Hi every body... Hoping that every is Ok for you...

I wrote some code for an simple application in dynamic programming... I'm interacting with the user through the standart I/O window...

On my first input from the user "scanf(...)" it doesn't take it so all my input is shift by one.. so every thing is mixed up... can some one find my problem because I'm a bit confused...

I did attached my source file

Best Regards

Steph
0 Kudos
Message 1 of 2
(2,848 Views)
Steph,
I think the problem is putting the \n within the specifier for your scanf function like scanf("%d\n",....)
This works much better if you place it in the printf statement, as that does not take an input, and I think this is what causes your problem with scanf. The printf statements then become printf("\n........")
0 Kudos
Message 2 of 2
(2,848 Views)