Logo Search packages:      
Sourcecode: mingw-w64 version File versions  Download package

t_staticconstmember.cc

#include <stdio.h>

00003 struct Foobar{
static const double var;
};

const double Foobar::var = 1.0;

int main()
{
const char * ptr = (const char *)(&Foobar::var);
for (int i=0; i < 8; ++i){
if (i) fprintf(stderr, ".");
fprintf(stderr, "%.2x", 0xFF & ptr[i]);
}
fprintf(stderr, " => %g : %g\n", Foobar::var, *((double*)ptr));

 return 0;
}


Generated by  Doxygen 1.6.0   Back to index