将int数组转换为向量最简单的方法是什么?并在if语句中使用它。将数组转换为向量
即
int num1[4] = {2, 4, 1, 8};
int num2[4] = {2, 4, 6, 8};
if (testNUM(num1, num2, 4))
cout << "ERROR: num1 and num2 are reported to be the same.\n";
else
cout << "SUCCESS: num1 and num2 are correctly identified "
<< "as different.\n";
testNUM被声明为函数原型(BOOL)。
感谢,
请定义'testNUM' –
'num1'和'num2'都是数组,为什么你需要将它们转换为向量? – azz