当我运行它时,它会给出一串数字和字母(我猜的地址)我哪里出错了?我试图显示最高和最低的数字
intArray 是 10 个数字的一维数组,大小 = 10
void greatAndSmall(int intsAray[], const int SZ, int greatAdd, int smallAdd) //def func
{
while (x < SZ)
{
if (intsAray[x] > greatAdd)
greatAdd = intsAray[x];
else
break;
if (intsAray[x] < smallAdd)
smallAdd = intsAray[x];
else
break;
x = x + 1;
}
}
greatAndSmall(intArray, SIZE, &great, &small); //IN MAIN FUNC
cout << "The smallest of these numbers is: " << small << "\n"; //display smallest
cout << "The largest of these numbers is: " << great; //display greatest