scanf problem in keil

Status
Not open for further replies.

tejasgol721

Newbie level 1
Joined
Feb 13, 2014
Messages
0
Helped
0
Reputation
0
Reaction score
0
Trophy points
0
Activity points
0
hii,

i am using C8051F340DK.

my program is

main()
{
while(1)
{
prtintf();

scanf ("%d",&input_key); // problem is created hear


switch (case)
{
cases:
break;

default:
printf();
}
}
}



connection with PC is using UART

when i try with entering decimal no. it work properly.
now problem is when i try to enter character it print default and continuously print it.

when i was trying getchar() insted of scanf() it was waking properly.

so plz. help me to solve this prblem

Thanks;
Tejas
 

please write complete cource code!

....
switch(case)

after this is variable cases
is this OK?
 

Complete your source code if you want.We can learn together.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…