大家帮我看一下这个简单的程序,错在何处?
错误的地方都在if语句这一行错误原因是:expression must have pointer-to-object type 应该是表达式必须要有指向对象类型?
到底是什么问题呀? 求解!
void calc_cycle(unsigned int volt_value)
{
unsigned int i=0;
unsigned int k=0;
unsigned int number_low = 0;
unsigned int number_high = 0;
if (volt_value[0] > 0x00) //if the first data is high level,then look for the first data
{ // which is low level
for (i=1;i<Num_of_Results;i++)
{
if (volt_value[i] == 0x00) // remember the first data which is low level
{k = i; break;}
else continue;
}
do
{
number_low ++;
} while (volt_value[k++] == 0x00); // count the number of low level data
do
{
number_high ++;
} while (volt_value[k++] > 0x00);
rate_dc(number_low,number_high); // transfer to the function to get the rate and dc
}
else if (volt_value[0] == 0x00)
{
for (i=1; i<Num_of_Results;i++)
{
if (volt_value[i] > 0x00)
{k = i; break;}
else continue;
}
do
{
number_high ++;
} while (volt_value[k++] !=0x00);
do
{
number_low ++;
} while (volt_value[k++] ==0x00);
rate_dc(number_low,number_high);
}
}