Top "C99" questions

This tag is for questions regarding the International Standard ISO 9899:1999, aka "C99", with technical corrigenda, and for questions about code written in C99 (as opposed to K&R C, C89 or later C Standard revisions like the 2011 revision C11).

Best way to shift an array in C?

I have an array that holds a history of values, and when adding a new value, I need to shift …

c arrays performance c99 byte-shifting
C99: what is the recomended way to handle exceptions raised by `pow()` (overflow or complex number)

executing double result = pow(base, exponent); with arbitrary base and exponent may result in an attempt to compute a value …

c exception nan c99 pow
GCC with -std=c99 complains about not knowing struct timespec

When I try to compile this on Linux with gcc -std=c99, the compiler complains about not knowing struct timespec. …

c posix c99 timespec
Enabling VLAs (variable length arrays) in MS Visual C++?

How can I enable the use of VLAs, variable length arrays as defined in C99, in MS Visual C++ or …

c visual-c++ c99 c89 variable-length-array
Good introduction to <inttypes.h>

I want to recommend the use of <inttypes.h> to someone doing printf with mixed 32/64 bit builds. I …

c printf c99
What is the header file for the uintptr_t type in modern C++?

I found that in C99 you should #include <stdint.h> and that seems to work with my C++03 …

c++ 32bit-64bit c99 stdint
Why is the fgets function deprecated?

From The GNU C Programming Tutorial: The fgets ("file get string") function is similar to the gets function. This function …

c file-io gnu c99 buffer-overflow
When __builtin_memcpy is replaced with libc's memcpy

There is a version of C99/posix memcpy function in GCC: __builtin_memcpy. Sometimes it can be replaced by GCC …

gcc c99 memcpy built-in
Dynamic array allocation on stack in C

I just did a experiment yesterday, and find something confusing: #include <stdio.h> int main() { int j; scanf("%…

c c99 c11 variable-length-array
The most useful user-made C-macros (in GCC, also C99)?

What C macro is in your opinion is the most useful? I have found the following one, which I use …

c macros c-preprocessor c99