4 ms·
You can return structs just fine in C. The reason it's not generally done in practice is because C lacks return value optimization - the compiler (almost?) alwa
by koverstreet 9y ago
You can return structs just fine in C. The reason it's not generally done in practice is because C lacks return value optimization - the compiler (almost?) always has to do a hidden memcpy() at the end of your function due to pointer aliasing.