65,211
社区成员
发帖
与我相关
我的任务
分享//unit1.h
#ifndef MYUNIT1_H
#define MYUNIT1_H
extern int i;
void Init();
#endif
//unit1.cpp
#include "Unit1.h"
int i;
void Init()
{
i=99;
}
// main.cpp
#include <stdio.h>
#include "Unit1.h"
int main(int argc, char *argv[])
{
Init();
printf("%d",i);
return 0;
}