Note that the temporary file name does not necessarily include the full path to the temporary directory. I.e. it may be just a plain file name or a full path depending on computing platform.
strcpy_s
is intended to overcome deficiencies in strncpy
and non-standard strlcpy
.
snprintf_s isn't yet widely available in common compilers.
C11 static_assert
issues compile-time errors if the assertion is false.
This can be useful particularly for IoT and embedded systems where integer types may
not behave the same
as the developer's laptop or other systems.
For legacy code, putting a couple static_assert
can flag the engineer right away if int
or long
aren't the expected bit width.
C11 introduced variable length arrays. C11 standard says VLA length cannot be 0. Some compilers allow this anyway so to be portable, don't have 0 length VLA.