Expected expression before ']' token?

前端 未结 4 1055
青春惊慌失措
青春惊慌失措 2021-01-26 15:43

I have the following line which sends the arguments args[] and length to a method called largest.

  printf(\"Largest is: %         


        
4条回答
  •  孤独总比滥情好
    2021-01-26 16:11

    because you need to place an integer between the operator square brakets, or otherwise don't specify the square brackets :

    printf("Largest is: %d \n", largest(&args[0], length));
    

    or

    printf("Largest is: %d \n", largest(args, length));
    

    Keep in mind that args[0] is the same as *(args + 0) but args[] will give an error because it needs a number to sum ...

提交回复
热议问题