Using pointers to swap int array values

前端 未结 7 1250
走了就别回头了
走了就别回头了 2021-01-05 17:57

I am supposed to use pointers to swap ints in an array. It compiles with no errors or warnings and runs but does not swap the ints. Any suggestions would be helpful!!!

相关标签:
7条回答
  • 2021-01-05 18:37

    your swap function will work only for 2-ints array, so show it to your compiler (it won't change anything, but make code cleaner)

    void swap( int ary[2] )
    
    0 讨论(0)
提交回复
热议问题