我在C++中创建了一个无效的环境函数中的向量调用核和单元。然后我调用创建病毒点向量的病毒函数。然后我想访问病毒调用的另一个功能中的载体细胞核和细胞。是否有可能在不通过病毒功能的情况下调用病毒?如果不是什么是最好的办法做到这一点?附件是我的代码。先谢谢了。我也没有添加的所有代码的函数内...只通过代码中的某些功能传递向量
struct point {
float x;
float y;
};
struct space{
point point1;
point point2;
point point3;
point point4;
};
int gelato(vector<point> & virus,int& times,int& iv, ofstream& data_file)
{
int a;
int b;
bool nc,cc,cmc;
for(int i =0; i<virus.size(); i++)
{
a = virus[i].x;
b = virus[i].y;
nc = nucleus_check(nucleus,a,b); // **Need to call vector cell and nucleus**
cc = cytoplasm_check(cell,a,b);
cmc = cell_membrane_check(cell,a,b);
}
}
int moves(char n)
{
int moved;
int trial;
if(n =='A')
{
moved = rand()%4;
}
else if(n=='B')
{
moved= rand()%3+1;
}
else if(n=='C')
{
trial= rand()%4;
if(trial ==1)
{
moves('C');
}
else
{
moved = trial;
}
}
else if(n =='D')
{
trial = rand()%4;
if(trial == 2)
{
moves('D');
}
else
{
moved = trial;
}
}
else if(n=='E')
{
moved = rand()%3;
}
return moved;
}
int v_move(vector<point>& virus, int& iv, ofstream& data_file)
{
gelato(virus,times,iv,data_file);
}
int rand_in(char a)
{}
void virus(ofstream& data_file)
{
v_move(virus, iv, data_file);
}
void cell_space(int r)
{
vector<point>cell;
}
void nucleus_space(int r)
{
vector<point>nucleus;
}
void environment() //**Where the vector nucleus and cell are created**
{
//cell
cell_space(16)
//nucleus
nucleus_space(4);
//cout<<"Environment"<<endl;
}
int main()
{
srand(time(NULL));
data_file.open("data.csv");
environment();
virus(data_file);
return 0;
}