Returning Arrays/Pointers from a function

前端 未结 7 1299
醉梦人生
醉梦人生 2020-11-28 12:07

I am trying to create a new integer array which is derived from a string of characters. For example :

char x[] = \"12334 23845 32084\";  

int y[] = { 12334,         


        
7条回答
  •  抹茶落季
    2020-11-28 13:04

    Of course it's possible. This is the way I prefer: int func(int** results)

    Function returns number of elements in results. results is a pointer to an int array.

提交回复
热议问题