Click here to Skip to main content
15,889,833 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: error C2143 error C2059 Pin
Richard MacCutchan31-Jul-19 2:54
mveRichard MacCutchan31-Jul-19 2:54 
GeneralRe: error C2143 error C2059 Pin
_Flaviu31-Jul-19 3:27
_Flaviu31-Jul-19 3:27 
GeneralRe: error C2143 error C2059 Pin
Richard MacCutchan31-Jul-19 4:03
mveRichard MacCutchan31-Jul-19 4:03 
GeneralRe: error C2143 error C2059 Pin
_Flaviu31-Jul-19 22:01
_Flaviu31-Jul-19 22:01 
GeneralRe: error C2143 error C2059 Pin
k505431-Jul-19 5:39
mvek505431-Jul-19 5:39 
GeneralRe: error C2143 error C2059 Pin
_Flaviu31-Jul-19 21:06
_Flaviu31-Jul-19 21:06 
QuestionRe: error C2143 error C2059 Pin
David Crow1-Aug-19 3:22
David Crow1-Aug-19 3:22 
AnswerRe: error C2143 error C2059 Pin
k50541-Aug-19 4:28
mvek50541-Aug-19 4:28 
David Crow wrote:
bool equals( struct foo f )
{
// this is not the preferred method for comparing floating-point values
return (this->s == f.s) && (this->d == f.d);
}

I use fabs(v1 - v2) < delta. Its OK to compare a floating point value against zero, but other comparisons may produce unexpected results. e.g.
$ cat ex.c
#include <stdio.h>

int main()
{
    double d = 0.0;
    const double one = 1.0;

    for(size_t i = 0; i < 100; ++i)
        d += 0.01;

    // we would expect d now to be 1.0, but ...

    printf("d = %8.6f\n", d);    // output looks like 1.000000
    printf("d == 1.0 => %d\n", d == one);  // but comparison fails
    printf("1.0 - d = %g\n", one -d);  // there's a very small diff btwn d and 1.0

    return 0;
}
$ ./ex
d = 1.000000
d == 1.0 => 0
1.0 - d = -6.66134e-16
$ 

GeneralRe: error C2143 error C2059 Pin
k50541-Aug-19 3:57
mvek50541-Aug-19 3:57 
GeneralRe: error C2143 error C2059 Pin
Richard MacCutchan31-Jul-19 21:32
mveRichard MacCutchan31-Jul-19 21:32 
GeneralRe: error C2143 error C2059 Pin
Peter_in_27801-Aug-19 0:53
professionalPeter_in_27801-Aug-19 0:53 
GeneralRe: error C2143 error C2059 Pin
Richard MacCutchan1-Aug-19 1:31
mveRichard MacCutchan1-Aug-19 1:31 
QuestionBest way to call REST Service from C++ Pin
ptr_Electron24-Jul-19 22:50
ptr_Electron24-Jul-19 22:50 
AnswerRe: Best way to call REST Service from C++ Pin
Gerry Schmitz25-Jul-19 2:49
mveGerry Schmitz25-Jul-19 2:49 
QuestionRe: Best way to call REST Service from C++ Pin
Richard MacCutchan25-Jul-19 3:52
mveRichard MacCutchan25-Jul-19 3:52 
AnswerRe: Best way to call REST Service from C++ Pin
Gerry Schmitz25-Jul-19 10:13
mveGerry Schmitz25-Jul-19 10:13 
GeneralRe: Best way to call REST Service from C++ Pin
Richard MacCutchan25-Jul-19 22:31
mveRichard MacCutchan25-Jul-19 22:31 
GeneralRe: Best way to call REST Service from C++ Pin
Gerry Schmitz25-Jul-19 22:48
mveGerry Schmitz25-Jul-19 22:48 
GeneralRe: Best way to call REST Service from C++ Pin
Richard MacCutchan25-Jul-19 23:29
mveRichard MacCutchan25-Jul-19 23:29 
GeneralRe: Best way to call REST Service from C++ Pin
Gerry Schmitz26-Jul-19 5:12
mveGerry Schmitz26-Jul-19 5:12 
QuestionCall C functions from VC++ Pin
_Flaviu17-Jul-19 22:20
_Flaviu17-Jul-19 22:20 
AnswerRe: Call C functions from VC++ Pin
phil.o17-Jul-19 23:19
professionalphil.o17-Jul-19 23:19 
GeneralRe: Call C functions from VC++ Pin
_Flaviu18-Jul-19 0:19
_Flaviu18-Jul-19 0:19 
GeneralRe: Call C functions from VC++ Pin
phil.o18-Jul-19 0:25
professionalphil.o18-Jul-19 0:25 
AnswerRe: Call C functions from VC++ Pin
Richard MacCutchan18-Jul-19 0:36
mveRichard MacCutchan18-Jul-19 0: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.