I have a piece of code:
Under Windows MSVC 2012
#include <stdio.h>
#include <string.h>
namespace myname{
double var = 42;
}
extern "C" double _ZN6myname3varE = 10.0;
int main(){
printf("%d\n", _ZN6myname3varE);
return 0;
}
The output is 0
. But I think the output should be 10
. Could you help explain why?