所以我正在调用一个简单的方法,从头文件到主C文件,它不起作用。任何线索?
Main
#include "header.h"
int main() {
int a = 2;
int b = 5;
int numArray[2] = {a, b};
displayNumbers(numArray, 2);
doubleIt(a);
doubleIt(b);
displayNumbers(numArray, 2);
return(0);
}
Header
int doubleIt(int x) {
return 2 * x;
}
void displayNumbers(int x[], int numSize) {
int i;
for (i = 0; i < numSize - 1; i++) {
printf("%d, ", x[i]));
printf("%d", x[numSize - 1]);
printf("\n");
}
doubleIt方法不起作用。
答案 0 :(得分:0)
如果我正确理解了您的问题,您希望将数组加倍并打印值,如果是<div class="div-roomcart" id="divOAK1AKL">
<div class="div-roomcart-hotel">
<div class="div-roomcart-hotelname">Eden Park Bed And Breakfast</div>
<div class="div-roomcart-roomtype">Single Standard</div>
</div>
<div class="div-roomcart-room">
<div class="div-roomcart-roomprice">14058.26</div>
<div class="div-roomcart-roomaction">
<input type="submit" id="submit" value="Remove" class="btnbook" onclick="removeroom('divOAK1AKL')">
</div>
</div>
和a = 2
,那么您希望加倍到b = 5
和{{ 1}}。
在代码中修改这些行,如下所示;
a = 4
希望这有帮助。