Click here to Skip to main content
16,006,490 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionPointer value is becoming garbage value Pin
subramanyeswari16-Jul-08 20:51
subramanyeswari16-Jul-08 20:51 
GeneralRe: Pointer value is becoming garbage value Pin
CPallini16-Jul-08 21:18
mveCPallini16-Jul-08 21:18 
AnswerRe: Pointer value is becoming garbage value Pin
Cedric Moonen16-Jul-08 21:23
Cedric Moonen16-Jul-08 21:23 
QuestionRe: Pointer value is becoming garbage value Pin
David Crow17-Jul-08 3:20
David Crow17-Jul-08 3:20 
QuestionValidate IP address with Regular Expression with Qt Pin
rajveer2116-Jul-08 20:04
rajveer2116-Jul-08 20:04 
QuestionDialog Box in different OS Pin
AdityaReddy16-Jul-08 19:25
AdityaReddy16-Jul-08 19:25 
AnswerRe: Dialog Box in different OS Pin
Nelek16-Jul-08 21:27
protectorNelek16-Jul-08 21:27 
QuestionWhat causes calculation difference in Debug/Release config mode. Pin
YangJoyLi16-Jul-08 18:50
YangJoyLi16-Jul-08 18:50 
When I use the following codes to calculate values, I always get different results for Debug and Release config.
Do you know what causes the difference, and which result is correct?
Part of the codes are as following:

========================================================================

GradeData tempGradeDataGD0;
GradeDataCRC tempGradeDataCRC;
unsigned long Index = 0, Orientation = 0, lcv = 0;
unsigned short SegmentID = 0, prevSegID = 0;
double Offset = 0, prevOffset = 0;
double Grade = 0, prevGrade = 0;
double SegLength = 0;


Input_File >> Index >> Grade >> SegmentID >> SegLength >> Offset >> Orientation;
Input_File.getline(tempString, 256, '\n');


tempGradeDataGD0.Distance = (unsigned long)floor(Offset * 256);

tempGradeCompDeceleration = (float)(2 + (2 * 9.81 * RoundToHundreths(Grade) / 100));

tempGradeDataGD0.Deceleration = (unsigned long)floor(tempGradeCompDeceleration * 256);


if(SegmentID == prevSegID)
deltaGradeZnOff = (float)(Offset - prevOffset); // float to ensure the precision.
else
deltaGradeZnOff = (float)Offset;
tempGradeCompVelocitySquare = tempGradeCompDeceleration * deltaGradeZnOff;

tempGradeDataGD0.VelocitySquare = (unsigned long)floor(tempGradeCompVelocitySquare * 256) * 256;

=======================================================================

"tempGradeDataGD0.VelocitySquare" always get different values.

Thanks.
AnswerRe: What causes calculation difference in Debug/Release config mode. Pin
Cedric Moonen16-Jul-08 20:25
Cedric Moonen16-Jul-08 20:25 
GeneralRe: What causes calculation difference in Debug/Release config mode. Pin
YangJoyLi17-Jul-08 4:15
YangJoyLi17-Jul-08 4:15 
QuestionThrough which Api , get the details of Events in vc++, And using which api I can regenerate. Pin
Renjith.k.p16-Jul-08 18:48
Renjith.k.p16-Jul-08 18:48 
QuestionFind a string in CEdit control Pin
Sunayna16-Jul-08 18:14
Sunayna16-Jul-08 18:14 
AnswerRe: Find a string in CEdit control Pin
Naveen16-Jul-08 18:29
Naveen16-Jul-08 18:29 
AnswerRe: Find a string in CEdit control Pin
kDevloper16-Jul-08 18:55
kDevloper16-Jul-08 18:55 
AnswerRe: Find a string in CEdit control Pin
CPallini16-Jul-08 21:26
mveCPallini16-Jul-08 21:26 
GeneralRe: Find a string in CEdit control Pin
Sunayna20-Jul-08 20:55
Sunayna20-Jul-08 20:55 
GeneralRe: Find a string in CEdit control Pin
CPallini20-Jul-08 21:24
mveCPallini20-Jul-08 21:24 
AnswerRe: Find a string in CEdit control Pin
ThatsAlok17-Jul-08 22:11
ThatsAlok17-Jul-08 22:11 
GeneralRe: Find a string in CEdit control Pin
Sunayna20-Jul-08 17:44
Sunayna20-Jul-08 17:44 
QuestionWhere to specify .res as Input to Linker on Visual Studio Pin
ForNow16-Jul-08 16:03
ForNow16-Jul-08 16:03 
AnswerRe: Where to specify .res as Input to Linker on Visual Studio Pin
zhwei16-Jul-08 18:22
zhwei16-Jul-08 18:22 
GeneralRe: Where to specify .res as Input to Linker on Visual Studio Pin
ForNow16-Jul-08 21:22
ForNow16-Jul-08 21:22 
Questionnewbie - compile c code to work with c++ code Pin
timverb16-Jul-08 10:29
timverb16-Jul-08 10:29 
AnswerRe: newbie - compile c code to work with c++ code Pin
kcynic16-Jul-08 16:30
kcynic16-Jul-08 16:30 
GeneralRe: newbie - compile c code to work with c++ code Pin
timverb17-Jul-08 11:36
timverb17-Jul-08 11:36 

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.