我在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;
}