15,789,698 members
Home / Discussions / C / C++ / MFC

# C / C++ / MFC

 Re: how do I verify - "all the ducks in the row "? trønderen25-Mar-22 13:58 trønderen 25-Mar-22 13:58
 Re: how do I verify - "all the ducks in the row "? k505426-Mar-22 6:07 k5054 26-Mar-22 6:07
 Re: how do I verify - "all the ducks in the row "? Richard MacCutchan25-Mar-22 23:51 Richard MacCutchan 25-Mar-22 23:51
 Message Closed 28-Mar-22 15:44 Member 14968771 28-Mar-22 15:44
 Message Closed 29-Mar-22 7:05 Member 14968771 29-Mar-22 7:05
 Re: how do I verify - "all the ducks in the row "? k505429-Mar-22 7:55 k5054 29-Mar-22 7:55
 Help with calculating percentage in C ForNow20-Mar-22 6:37 ForNow 20-Mar-22 6:37
 Re: Help with calculating percentage in C k505420-Mar-22 6:54 k5054 20-Mar-22 6:54
 Presumably you're doing something like C ```int total = 100; int unalloc = 96; double percent = unalloc/total;``` So the problem here is that since unaloc and total are both `int`, the calculation is done in integer math, and then promoted to double. What you need to do is to promote either operand to the division to double (or both): C `double percent = (double)unalloc/total:` Keep Calm and Carry On
 Re: Help with calculating percentage in C ForNow20-Mar-22 7:47 ForNow 20-Mar-22 7:47
 Re: Help with calculating percentage in C Calin Negru20-Mar-22 9:41 Calin Negru 20-Mar-22 9:41
 Re: Help with calculating percentage in C RedDk21-Mar-22 8:16 RedDk 21-Mar-22 8:16
 Re: Help with calculating percentage in C Victor Nijegorodov20-Mar-22 8:42 Victor Nijegorodov 20-Mar-22 8:42
 Re: Help with calculating percentage in C ForNow20-Mar-22 10:02 ForNow 20-Mar-22 10:02
 Message Closed 18-Mar-22 16:23 Member 14968771 18-Mar-22 16:23
 Re: How to pass pointers and process them using ellipsis ? Richard MacCutchan19-Mar-22 0:08 Richard MacCutchan 19-Mar-22 0:08
 Message Closed 19-Mar-22 5:06 Member 14968771 19-Mar-22 5:06
 Re: How to pass pointers and process them using ellipsis ? k505419-Mar-22 6:01 k5054 19-Mar-22 6:01
 Message Closed 19-Mar-22 9:44 Member 14968771 19-Mar-22 9:44
 Re: How to pass pointers and process them using ellipsis ? k505419-Mar-22 13:00 k5054 19-Mar-22 13:00
 Re: How to pass pointers and process them using ellipsis ? Richard MacCutchan19-Mar-22 7:11 Richard MacCutchan 19-Mar-22 7:11
 working with pointers Calin Negru17-Mar-22 22:48 Calin Negru 17-Mar-22 22:48
 Re: working with pointers Victor Nijegorodov18-Mar-22 0:16 Victor Nijegorodov 18-Mar-22 0:16
 Re: working with pointers Calin Negru18-Mar-22 1:12 Calin Negru 18-Mar-22 1:12
 Re: working with pointers Victor Nijegorodov18-Mar-22 2:39 Victor Nijegorodov 18-Mar-22 2:39
 Re: working with pointers Calin Negru18-Mar-22 11:20 Calin Negru 18-Mar-22 11:20
 Last Visit: 31-Dec-99 19:00     Last Update: 28-Nov-23 3:29 Refresh ᐊ Prev1...60616263646566676869 Next ᐅ