Is it possible to dynamically define a struct in C

前端 未结 6 1997
暗喜
暗喜 2020-12-14 16:16

I\'m pretty sure this will end up being a really obvious question, and that\'s why I haven\'t found much information on it. Still, I thought it was worth asking :)

B

6条回答
  •  盖世英雄少女心
    2020-12-14 16:34

    For dynamic structure, the answer is no.

    If you know what data comes in, in C++, you can use the overloaded << in operator to read the data from the stream..

    In C, you could convert the stream to a string assuming that you know the length of the data comes in and using the function like sscanf, you could read the data.

提交回复
热议问题