Click here to Skip to main content
15,911,531 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: Unique Windows ID Pin
David Crow23-Aug-07 5:03
David Crow23-Aug-07 5:03 
AnswerRe: Unique Windows ID Pin
James R. Twine23-Aug-07 5:17
James R. Twine23-Aug-07 5:17 
QuestionRound Decimal value to... Pin
Super Hornet23-Aug-07 4:14
Super Hornet23-Aug-07 4:14 
AnswerRe: Round Decimal value to... Pin
David Crow23-Aug-07 4:29
David Crow23-Aug-07 4:29 
AnswerRe: Round Decimal value to... Pin
jhwurmbach23-Aug-07 4:43
jhwurmbach23-Aug-07 4:43 
AnswerRe: Round Decimal value to... Pin
Iain Clarke, Warrior Programmer23-Aug-07 4:51
Iain Clarke, Warrior Programmer23-Aug-07 4:51 
GeneralRe: Round Decimal value to... Pin
Super Hornet24-Aug-07 5:47
Super Hornet24-Aug-07 5:47 
AnswerRe: Round Decimal value to... Pin
ghle26-Aug-07 11:22
ghle26-Aug-07 11:22 
Iain had good answer for positive numbers.

RoundABit(-1.59999) would return -1.5, not -1.6 as it should.Frown | :(

Corrected to allow positive or negative, added Factor for variable decimal place position, and made it execute faster...Smile | :)

float RoundedABitToo (float fVal, float fFactor = 10.0)
{
   return (floor((fVal * fFactor) + (fVal >= 0.0 ? 0.5 : -0.5)))/fFactor;
}


Gary
GeneralRe: Round Decimal value to... Pin
Super Hornet28-Aug-07 4:36
Super Hornet28-Aug-07 4:36 
QuestionSTL memory - delete/de-allocate mem for individual list element?? [modified] Pin
devvvy23-Aug-07 2:56
devvvy23-Aug-07 2:56 
QuestionRe: STL memory - delete/de-allocate mem for individual list element?? Pin
Maximilien23-Aug-07 3:04
Maximilien23-Aug-07 3:04 
AnswerRe: STL memory - delete/de-allocate mem for individual list element?? [modified] Pin
jhwurmbach23-Aug-07 3:09
jhwurmbach23-Aug-07 3:09 
GeneralRe: STL memory - delete/de-allocate mem for individual list element?? Pin
toxcct23-Aug-07 3:39
toxcct23-Aug-07 3:39 
GeneralRe: STL memory - delete/de-allocate mem for individual list element?? Pin
James R. Twine23-Aug-07 3:50
James R. Twine23-Aug-07 3:50 
GeneralRe: STL memory - delete/de-allocate mem for individual list element?? Pin
jhwurmbach23-Aug-07 3:50
jhwurmbach23-Aug-07 3:50 
GeneralRe: STL memory - delete/de-allocate mem for individual list element?? Pin
toxcct23-Aug-07 3:53
toxcct23-Aug-07 3:53 
GeneralRe: STL memory - delete/de-allocate mem for individual list element?? Pin
devvvy23-Aug-07 13:47
devvvy23-Aug-07 13:47 
GeneralRe: STL memory - delete/de-allocate mem for individual list element?? Pin
jhwurmbach23-Aug-07 21:33
jhwurmbach23-Aug-07 21:33 
AnswerRe: STL memory - delete/de-allocate mem for individual list element?? Pin
David Crow23-Aug-07 3:19
David Crow23-Aug-07 3:19 
GeneralIs this how? ACTION 1/2/3/4/5?? [modified] Pin
devvvy23-Aug-07 15:43
devvvy23-Aug-07 15:43 
GeneralRe: Is this how? ACTION 1/2/3/4/5?? Pin
David Crow24-Aug-07 5:14
David Crow24-Aug-07 5:14 
QuestionHow to generate GUID. Pin
veer_in23-Aug-07 2:43
veer_in23-Aug-07 2:43 
AnswerRe: How to generate GUID. Pin
David Crow23-Aug-07 2:51
David Crow23-Aug-07 2:51 
QuestionRe: How to generate GUID. Pin
veer_in23-Aug-07 3:07
veer_in23-Aug-07 3:07 
AnswerRe: How to generate GUID. Pin
David Crow23-Aug-07 3:18
David Crow23-Aug-07 3:18 

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.