#include <iostream>
#include <cmath>
#include <stdio.h>
#include <stdlib.h>
using namespace std;
int c;
void main()
{
int a=1;
int b=2;
c=a+b;
}
int demo(void)
{
cout<<c<<endl;
system("pause");
return 0 ;
}
哦哦,我明白这个了,那我还想问一下在MFC中要将一个函数的值用到另一个函数中要怎么办?我定义了一个全局变量,但发现函数中的值没能传到全局变量中,所以在下一个函数中也就不能用了。
追答没有传到全局变量中?
你怎么样传的?语句发出来。
有必要的话发程序。