~mingw-w64/mingw-w64/experimental

« back to all changes in this revision

Viewing changes to ros-privexp/mingw-w64-crt/testcases/t_staticconstmember.cc

  • Committer: NightStrike
  • Date: 2010-08-11 22:20:57 UTC
  • Revision ID: svn-v4:4407c894-4637-0410-b4f5-ada5f102cad1:experimental:3266
Branch for adding option for supporting ros

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <stdio.h>
 
2
 
 
3
struct Foobar{
 
4
static const double var;
 
5
};
 
6
 
 
7
const double Foobar::var = 1.0;
 
8
 
 
9
int main()
 
10
{
 
11
const char * ptr = (const char *)(&Foobar::var);
 
12
for (int i=0; i < 8; ++i){
 
13
if (i) fprintf(stderr, ".");
 
14
fprintf(stderr, "%.2x", 0xFF & ptr[i]);
 
15
}
 
16
fprintf(stderr, " => %g : %g\n", Foobar::var, *((double*)ptr));
 
17
 
 
18
 return 0;
 
19
}
 
20