How can I call (not define) a function with a variable number of arguments in C?

前端 未结 6 1763
感情败类
感情败类 2021-01-20 01:05

Is there any way to make this code shorter?

long call_f(int argc, long *argv) {
  switch (argc) {
    case 0:
      return f();
      break;
    case 1:
             


        
6条回答
  •  逝去的感伤
    2021-01-20 01:28

    Does f have to accept a variable number of pointers to long? Can you rewrite it to accept an array and a count?

提交回复
热议问题