How to use the return value of a function with parameters inside another function

后端 未结 6 1266
孤城傲影
孤城傲影 2021-01-29 15:59

All these functions are outside the int main():

int func1(int x) {

    int v1 = 6 * x;
    return v1; // the input argument will be 2, so v1 = 12
}

int func2()         


        
6条回答
  •  北海茫月
    2021-01-29 16:47

    The function needs an argument, so pass it an argument.

    It's as simple as that.

提交回复
热议问题