https://beej.us/guide/bgc/↩︎
https://en.wikipedia.org/wiki/ANSI_C↩︎
https://en.wikipedia.org/wiki/POSIX↩︎
https://visualstudio.microsoft.com/vs/community/↩︎
https://docs.microsoft.com/en-us/windows/wsl/install-win10↩︎
https://developer.apple.com/xcode/↩︎
https://beej.us/guide/bgclr/↩︎
https://en.cppreference.com/↩︎
https://groups.google.com/g/comp.lang.c↩︎
https://www.reddit.com/r/C_Programming/↩︎
This doesn’t change the type of x
in other contexts—it’s just in this one usage in this expression.↩︎
Note that this implication only for main()
, and not for any other functions.↩︎
https://en.wikipedia.org/wiki/Complex_conjugate↩︎
https://en.wikipedia.org/wiki/Riemann_sphere↩︎
Really it’s just required to be a modifiable lvalue, so not necessarily a variable. But you can treat it as such.↩︎
https://man.archlinux.org/man/errno.3.en↩︎
https://docs.microsoft.com/en-us/cpp/c-runtime-library/errno-constants?view=msvc-160↩︎
https://en.wikipedia.org/wiki/Subnormal_number↩︎
The minimum value of an unsigned char
is 0
. Same fo an unsigned short
and unsigned long
. Or any unsigned type, for that matter.↩︎
https://en.wikipedia.org/wiki/Two%27s_complement↩︎
Remember that char
is just a byte-sized integer.↩︎
Though the system defines MATH_ERRNO
as 1
and MATH_ERREXCEPT
as 2
, it’s best to always use their symbolic names. Just in case.↩︎
https://en.wikipedia.org/wiki/Denormal_number↩︎
This is on my system. Some systems will have different points at which numbers become subnormal, or they might not support subnormal values at all.↩︎
https://en.wikipedia.org/wiki/E_(mathematical_constant)↩︎
https://en.wikipedia.org/wiki/Denormal_number↩︎
https://en.wikipedia.org/wiki/Pythagorean_theorem↩︎
https://en.wikipedia.org/wiki/Error_function↩︎
https://en.wikipedia.org/wiki/Error_function↩︎
https://en.wikipedia.org/wiki/Gamma_function↩︎
https://en.wikipedia.org/wiki/Gamma_function↩︎
https://en.cppreference.com/w/c/numeric/math/remquo↩︎
https://en.cppreference.com/w/c/numeric/math/remquo↩︎
A quiet NaN is one that doesn’t raise any exceptions.↩︎
https://man.archlinux.org/man/sigaction.2.en↩︎
As if might be sent from Unix’s kill
command.]↩︎
https://en.wikipedia.org/wiki/Data_structure_alignment↩︎
Maybe it depends on the run-time environment and can’t be known at compile-time.↩︎
https://en.cppreference.com/w/cpp/atomic/ATOMIC_VAR_INIT↩︎
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1138r0.pdf↩︎
This effectively does the same thing, but it’s clearly not atomic.↩︎
The spec says, “This spurious failure enables implementation of compare-and-exchange on a broader class of machines, e.g. load-locked store-conditional machines.” And adds, “When a compare-and-exchange is in a loop, the weak version will yield better performance on some platforms. When a weak compare-and-exchange would require a loop and a strong one would not, the strong one is preferable.”↩︎
Don’t use this unless you know what you’re doing—use the thread mutex functionality instead. It’ll let your blocked thread sleep and stop chewing up CPU.↩︎
Don’t use this unless you know what you’re doing—use the thread mutex functionality instead. It’ll let your blocked thread sleep and stop chewing up CPU.↩︎
https://en.wikipedia.org/wiki/Data_structure_alignment↩︎
https://man.archlinux.org/man/unlinkat.2.en#DESCRIPTION↩︎
https://man.archlinux.org/man/mkstemp.3.en↩︎
https://nee.lv/2021/02/28/How-I-cut-GTA-Online-loading-times-by-70/↩︎
https://stackoverflow.com/questions/17017331/c99-vscanf-for-dummies/17018046#17018046↩︎
http://man.cat-v.org/unix-1st/3/atof↩︎
http://man.cat-v.org/unix-1st/3/atoi↩︎
https://en.wikipedia.org/wiki/Radix↩︎
https://stackoverflow.com/questions/10984974/why-do-people-say-there-is-modulo-bias-when-using-a-random-number-generator↩︎
https://mumble.net/~campbell/2014/04/28/uniform-random-float↩︎
https://www.gnu.org/software/gsl/doc/html/rng.html↩︎
Minecraft enthusiasts might recall that when generating a new world, they were given the option to enter a random number seed. That single value is used to generate that entire random world. And if your friend starts a world with the same seed you did, they’ll get the same world you did.↩︎
https://en.wikipedia.org/wiki/Unix_time↩︎
The C spec doesn’t say exactly what time(NULL)
will return, but the POSIX spec does! And virtually everyone returns exactly that: the number of seconds since epoch.↩︎
https://en.wikipedia.org/wiki/Data_structure_alignment↩︎
“Try to imagine all life as you know it stopping instantaneously and every molecule in your body exploding at the speed of light.” —Egon Spengler↩︎
https://en.wikipedia.org/wiki/Core_dump↩︎
quick_exit()
differs from exit()
in that open files might not be flushed and temporary files might not be removed.↩︎
“In-place” meaning that the original array will hold the results; no new array is allocated.↩︎
It always returns the number of bytes the transformed string took, but in this case because s1
was NULL
, it doesn’t actually write a transformed string.↩︎
Which you should because of spurious wakeups.↩︎
Well, as at least as many things as you have free cores. Your OS will schedule them as it can.↩︎
For example, if a destructor caused more variables to be set.↩︎
Unix-like systems have a sleep()
syscall that sleeps for an integer number of seconds. But thrd_sleep()
is likely more portable and gives subsecond resolution, besides!↩︎
When you say GMT, unless you’re talking specifically about the time zone and not the time, you probably mean “UTC”.↩︎
The spec doesn’t actually say “clock ticks”, but I… am.↩︎
Unless you’re on a POSIX system where time_t
is definitely an integer, in which case you can subtract. But you should still use difftime()
for maximum portability.↩︎
https://man.archlinux.org/man/timegm.3.en↩︎
https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/mkgmtime-mkgmtime32-mkgmtime64?view=msvc-160↩︎
https://en.wikipedia.org/wiki/Unix_time↩︎
https://en.wikipedia.org/wiki/ISO_week_date↩︎
https://en.wikipedia.org/wiki/Symbols_for_Legacy_Computing↩︎
https://stackoverflow.com/questions/17017331/c99-vscanf-for-dummies/17018046#17018046↩︎
This is a variable, not a macro, so if you use it to define an array, it’ll be a variable-length array.↩︎