4 ms·
There's really no need for the pointer inside the struct. You could just use a flexible array member (introduced in C99) or a "struct hack" if you're still usin
by DrJokepu 14y ago
There's really no need for the pointer inside the struct. You could just use a flexible array member (introduced in C99) or a "struct hack" if you're still using C89.
- to3m 14y agoIf you do this, the Vector could likely move when resized.
- DrJokepu 14y agoTrue, the vector_append function would have to return a pointer to the new location; this might or might not be a problem, depending on how your program is structured.
- Mooby 14y agoYou mean "Variable-Length array", also referred to as VLA, not "flexible array member".
- icebraining 14y agoMooby, you're hellbanned and showing as [dead].
- Mooby 14y agoI had to google to see what that meant. It appears that some moderator is a bit touchy regarding the Go programming language, because of all the comments I've made that's the only one that was modded as negative.