|
헤더에다가 값을넣어놓으면 헤더를 인클루드 하는 순간 local변수가 됩니다.
이렇게 하시요
// user.h
extern int aa;
//user.cpp
int aa=100;
//다른 폼에서
#include "user.h"
Label1->Caption = IntToStr(aa);
이상입니다.
초보 님이 쓰신 글 :
: 답변 감사드립니다.
:
: user.h 헤더화일에서
: int aa;
:
: Form1.cpp 에서
: #include "user.h"
: '
: '
: '
: aa=100;
:
: Form2.cpp 에서
: #include "user.h"
: '
: '
: '
: Label1->Caption = aa;
:
: 위와 같이 프로그램 했을 경우 aa의
: 값이'100' 이 되게 ....
: 현재는 '0'가 Display 됩니다.
|