Click here to Skip to main content
15,922,145 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: how to compare date? Pin
neodeaths1-Aug-05 16:22
neodeaths1-Aug-05 16:22 
GeneralRe: how to compare date? Pin
Marc Soleda1-Aug-05 20:03
Marc Soleda1-Aug-05 20:03 
AnswerRe: how to compare date? Pin
David Crow26-Jul-05 2:46
David Crow26-Jul-05 2:46 
GeneralRe: how to compare date? Pin
neodeaths26-Jul-05 18:20
neodeaths26-Jul-05 18:20 
GeneralRe: how to compare date? Pin
David Crow27-Jul-05 2:28
David Crow27-Jul-05 2:28 
Generalhelp me debug this pls Pin
neodeaths25-Jul-05 23:36
neodeaths25-Jul-05 23:36 
GeneralRe: help me debug this pls Pin
Marc Soleda26-Jul-05 0:25
Marc Soleda26-Jul-05 0:25 
GeneralRe: help me debug this pls Pin
GDavy26-Jul-05 1:57
GDavy26-Jul-05 1:57 
Ok, the problem is the way doubles are handled which causes your "bug". A rounding factor gets accumulated so to do what you want to do I think you best introduce an extra variable...
Following code works:

<code>float a2=(float)5.550;
float money[6] = {(float)1.00,(float)0.50,(float)0.20,(float)0.10,(float)0.05,(float)0.01};//types
int moneychange[6] ;//change
float accounted=0;

for (star=0;star<6&& accounted < a2;star++)
{
moneychange[star] = (a2-accounted) / money[star];
accounted += money[star] * moneychange[star];;
cout << moneychange[star]<<endl;
cout << a2-accounted<<endl;
}</code>

GeneralRe: help me debug this pls Pin
Mike Dimmick26-Jul-05 2:43
Mike Dimmick26-Jul-05 2:43 
Questionhow to................. Pin
Member 214683925-Jul-05 23:27
Member 214683925-Jul-05 23:27 
AnswerRe: how to................. Pin
David Crow26-Jul-05 2:50
David Crow26-Jul-05 2:50 
AnswerRe: how to................. Pin
Member 214683926-Jul-05 4:59
Member 214683926-Jul-05 4:59 
Generaltapi 2.2 lineMonitorTones Pin
nripun25-Jul-05 22:53
nripun25-Jul-05 22:53 
GeneralUse of string in switch case Pin
itkid25-Jul-05 22:53
itkid25-Jul-05 22:53 
GeneralRe: Use of string in switch case Pin
berndg25-Jul-05 23:56
berndg25-Jul-05 23:56 
GeneralRe: Use of string in switch case Pin
Iain Clarke, Warrior Programmer26-Jul-05 0:23
Iain Clarke, Warrior Programmer26-Jul-05 0:23 
GeneralRe: Use of string in switch case Pin
berndg26-Jul-05 4:18
berndg26-Jul-05 4:18 
GeneralRe: Use of string in switch case Pin
markkuk26-Jul-05 12:09
markkuk26-Jul-05 12:09 
GeneralRe: Use of string in switch case Pin
itkid27-Jul-05 2:31
itkid27-Jul-05 2:31 
QuestionHow to monitor a file's actions? Pin
wood25-Jul-05 22:52
wood25-Jul-05 22:52 
AnswerRe: How to monitor a file's actions? Pin
David Crow26-Jul-05 2:57
David Crow26-Jul-05 2:57 
GeneralSorry,my explanation isn't clear! Pin
wood26-Jul-05 15:36
wood26-Jul-05 15:36 
GeneralRe: Sorry,my explanation isn't clear! Pin
David Crow27-Jul-05 2:42
David Crow27-Jul-05 2:42 
Generalsetting Timeout ..Please help me out Pin
Smith#25-Jul-05 22:51
Smith#25-Jul-05 22:51 
GeneralRe: setting Timeout ..Please help me out Pin
Marc Soleda25-Jul-05 23:31
Marc Soleda25-Jul-05 23:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.