hey
ok for school i have to get this text exercise to work they gave me code but it has an infinite loop so im fixing it:
original code:
modified:Code:double sales = 0.0; Console::Write("Enter a sa;es amount: "); sales = Convert::ToDouble(Console::ReadLine()); while (sales > 0) { Console::WriteLine(Sales * .1); }// end while
the problem it seems to have is with the char::toupper(exit)Code:double sales = 0.0; char exit = ' '; while (exit == 'Q') { Console::Write("Enter a sales amount: "); sales = Convert::ToDouble(Console::ReadLine()); Console::WriteLine(sales * .1); Console::Write("Do you want to quit(q)? "); exit = Convert::ToChar(Console::ReadLine()); exit = char::toupper(exit); }//End While
yet i checked my notes and that is what i see written down so what is .net complaining with char's this time???
c:\Documents and Settings\Owner\My Documents\Visual Studio Projects\Exercise 19\Exercise 19.cpp(21): error C2062: type 'char' unexpected
is the error i get and of course it warning me for using a char since .net hates them for some lame reason
so any ideas why?
thanks



LinkBack URL
About LinkBacks


