I understand how to create a struct
on the heap using malloc
. Was looking for some documentation regarding creating a struct
in C on the stack but all docs. seem to talk about struct creation on heap only.
相关问题
- Multiple sockets for clients to connect to
- What is the best way to do a search in a large fil
- glDrawElements only draws half a quad
- Index of single bit in long integer (in C) [duplic
- Equivalent of std::pair in C
I got it to work this way:
To declare a struct on the stack simply declare it as a normal / non-pointer value
The same way you declare any variable on the stack: