안녕하세요
Visual Studio (9.00 컴파일러를 이용하여 C++로 개발을 하고 있는데, volatile 구조체 문제가 있네요
내용인즉슨
a.cpp 에는
#include "stdafx.h"
extern volatile a_t gReg;
int main()
{
printf("reg : %d \n",gReg.a
}
b.cpp에는
#include "stdafx.h"
volatile a_t gReg;
void setReg()
{
a_t testReg = gReg;
}
라고 할때..
stdafx.h에는
단순하게
typedef struct {
short a;
short b;
short c;
} TestStruct_t;
typedef TestStruct_t a_t;
라고 하면