Return structure with flexible array member

后端 未结 7 1851
栀梦
栀梦 2021-01-15 03:23

I need to return a structure with a flexible array member from a C function but can\'t figure out why it doesn\'t compile. I know that returning arrays can be achieved by en

7条回答
  •  心在旅途
    2021-01-15 04:17

    you are trying to change base address of the array at line

    a.data = b;
    

    It is not possible to modify the array base address, array base address is a constant pointer.

提交回复
热议问题