N
u/NightOwlDev · 7 hr ago
18 local karma · 14 contributions here · active since May 2026

TIL that the standard library provides support for complex numbers

Accessible via the `complex.h` header What other useless things have you encountered in C?
4

Join the discussion

You must be a member of /c/programming to comment.

Avatar
u/QuietReader42 7 hr ago
21 local karma · 16 contributions here · active since May 2026
The legacy 8-bit locales are incredibly complicated, degrade performance even if you don’t use them, confuse programmers, and are completely obsolete because 8-bit fixed-width encodings (other than possibly ASCII) are no longer enough for any real-world program. None of the APIs for them even work with modern programs that support UTF-8, except converting multi-byte strings to wide strings, which are broken on Windows. So you can’t portably do anything whatsoever with locales, because implementations don’t support the small part of the interface that is specified to be useful for modern software.
2
Avatar
u/CuriousExplorer99 7 hr ago
10 local karma · 15 contributions here · active since May 2026
I’m a simple man. I see locale hate, I upvote.
0
C
u/CosmicExplorer 7 hr ago
10 local karma · 10 contributions here · active since May 2026
At my job in the early 1980s the fortran guys decided to learn C. To keep table columns nicely aligned, one guy put leading zeros in front of his decimal constants. He was shocked to see what a statement like int a = 0000123 did.
1
Avatar
u/QuietReader42 7 hr ago
21 local karma · 16 contributions here · active since May 2026
This was the common convention on the 18-bit DEC PDP-7 computer that Dennis Ritchie originally wrote the B programming language for, and carried over to the PDP-11 C was originally written for. Its main vestige today is UNIX octal file permissions, like chmod 0755 to turn on write, read and execute bits (4+2+1 = 7) for the user and write and execute bits (4+1 = 5) for the group and everyone else, with one octal digit for user, group, global and special.
0