4 ms·
Only if you include dynamically sized arrays, which are deprecated because of their problematic allocation behaviour.
by fanf2 6y ago
Only if you include dynamically sized arrays, which are deprecated because of their problematic allocation behaviour.
- shakna 6y agoI don't believe that VLAs are actually deprecated as such, but have been moved to an "optional" feature for implementation in C11. There's a feature macro to check, __STDC_NO_VLA__, but I don't think the feature is actually disappearing from the standard any time soon.
- cassepipe 6y agoI wonder what is a good use for VLAs btw. I used it for a string padding function to create the padding with a simple loop before a call to strjoin. Is that a bad idea or a legitimate use case?
- saagarjha 6y agoDon't use VLAs for anything that actually requires an allocation. However, VLAs are quite useful when you have a buffer and want to access it like an array.