我想使用'如果'条件来检查一个对象的位置是否为空。我正在使用双指针。请参阅下面的代码:如何检查双指针空的空间(NULL)
void show_room :: buy_car(int clmn, int row)
{
int row = row;
int clmn = clmn;
string car_door_col;
string temp1;
float temp2;
int temp3;
int n=0, i;
this->HBM = new show_room*[3];
for(int i=0; i<3; i++)
{
this->HBM[i] = new show_room[4];
}
for(int j=0; j<row; j++)
{
if(this->HBM[clmn][row] == NULL)
{
}
}
}
在这个循环中:
for(int j=0; j<row; j++)
{
if(this->HBM[clmn][row] == NULL)
{
}
}
我想检查是否有在[clmn] [行]或不是一个对象,我使用NULL的这是错误的。我该如何实现这一点。在这方面请帮助我。
什么是show_room?一类? – walkingTarget 2011-04-06 14:08:39
为什么哦为什么你这样做:'int row = row; int clmn = clmn;' – meagar 2011-04-06 14:24:56
是show_room是一个类。 – Rafay 2011-04-06 14:29:00