64,685
社区成员
发帖
与我相关
我的任务
分享
#include "c.h"
#include "start.h"
#include "cla.h"
C c;
main()
{
switch()
{
case A:
Fun();
case B:
c.Funa();//比如在这里打印随机产生的m值吗
}
void Fun();
#include "start.h"
void Foun()
{
int m=0;
m=rand()%10;//随机产生一个数
}
class C
{
public:
void Funa();
};
#include "cla.h"
void C::Fun()
{
int i=0;
i=m//要为start.cpp 产生的随机数。 怎么得到?
}
void Fun();
extern int ret;
#include "start.h"
int ret;
void Foun()
{
int m=0;
m=rand()%10;//随机产生一个数
ret = m;
}
#include "cla.h"
#include "start.h"
void C::Fun()
{
int i=0;
i=ret;//要为start.cpp 产生的随机数。 怎么得到?
//打印i出来
}
int Foun()
{
return rand()%10;//这里返回
}
void C::Fun()
{
int i=0;
i=Foun()//这里调用
}