-
October 21st, 2003, 10:15 AM
#1
c++ issue(urgent)
Rone is float.
cout << "Enter R1 of Delta Network" <<"\n";
cin >> Rone;
if(Rone>0)
{
}
else
{
cout<< "R1 does not accept zero ,negative and character values";
cout << "Enter R1 of Delta Network" <<"\n";
cin >> Rone;
}
My mistake if i press any character it's going into the loop.It's not stopping.How to solve this problem.
Thanks and regards,
Mala
-
October 21st, 2003, 10:34 AM
#2
What loop?
Please give us more details!
-
October 21st, 2003, 11:00 AM
#3
Characters have a numeric value that is > 0.
For instance:
'A' == 0x41
'B' == 0x42
-
October 21st, 2003, 06:01 PM
#4
loop means
again and again The below message are displaying.
Messages("R1 does not accept zero ,negative and character values ,Enter R1 of Delta Network")
It's going to line1 and line2 .It's not going to line no 3.If it's goes only i can enter the input again.
line1,
cout<< "R1 does not accept zero ,negative and character values";
line2,
cout << "Enter R1 of Delta Network" <<"\n";
line3,
cin >> Rone
How to stop this message and give input to cin >>Rone
Thanks and regards,
Mala
-
October 21st, 2003, 06:09 PM
#5
Originally posted by malab
loop means
again and again The below message are displaying.
Messages("R1 does not accept zero ,negative and character values ,Enter R1 of Delta Network")
It's going to line1 and line2 .It's not going to line no 3.If it's goes only i can enter the input again.
line1,
cout<< "R1 does not accept zero ,negative and character values";
line2,
cout << "Enter R1 of Delta Network" <<"\n";
line3,
cin >> Rone
How to stop this message and give input to cin >>Rone
Thanks and regards,
Mala
Can you post your loop code snippet, the one which uses while/for or something similar to loop your messages around...(*)
Regards,
Fiona
@Edit@ I forgot to include
Last edited by hometown; October 21st, 2003 at 06:13 PM.
-
October 21st, 2003, 07:22 PM
#6
Plenty of previous threads about this topic. Heres one. Maybe it'll
help.
http://www.codeguru.com/forum/showth...light=cin.fail
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|