C subscripted value is neither array nor pointer nor vector when assigning an array element value

后端 未结 6 773
悲&欢浪女
悲&欢浪女 2020-12-09 09:36

Sorry for asking the already answered question, I am a newbie to C and don\'t understand the solutions. Here is my function

int rotateArr(int *arr) {
    int         


        
6条回答
  •  遥遥无期
    2020-12-09 10:08

    the second subscript operator is invalid here. You passed a int * pointer into function, which is a 1-d array. So only one subscript operator can be used on it.

    Solution : you can pass int ** pointer into funciton

提交回复
热议问题