How Do I/O Streams Work in the C Standard Library?
C streams are FILE pointers used by stdio.h. Learn the standard streams, file reading and writing, binary I/O and buffering with working examples.
Spread Your Knowledge. Questions with answers, tutorials and articles, newest first.
C streams are FILE pointers used by stdio.h. Learn the standard streams, file reading and writing, binary I/O and buffering with working examples.
C strings are null-terminated char arrays. Learn the string.h functions, how to avoid buffer overflows, and how to convert text to numbers safely.
Which C headers handle numbers: math.h, limits.h, float.h, stdint.h, stdlib.h and C23 stdckdint.h. Examples cover math, ranges, parsing and overflow checks.
C has no iterator type. Pointers, node traversal and small iterator structs do the job. See safe patterns and pitfalls with runnable code.
The C Standard Library has no vector, list or map. See how to build dynamic arrays and linked lists, and use qsort and bsearch for sorted data.
The C standard library is a portable set of functions for I/O, strings, memory, math and time, declared in standard headers like stdio.h and string.h.
Learn which algorithms the C standard library offers: qsort, bsearch and the mem and str functions, with safe comparators and working code.
The STL is the template-based core of the C++ standard library: containers, iterators and algorithms. See working examples, including C++20 ranges.
Learn what the C standard library is, which headers it includes, how to use it safely and which functions are removed or unsafe in C17 and C23.
There is no official C Core Guidelines. Learn what the C++ Core Guidelines are, how to enforce them, and which standards to use for plain C code.
An lvalue in C designates an object with a memory location; an rvalue is just a value. See examples, modifiable lvalues and common compiler errors.
A C expression combines operands and operators into a value. See the kinds of expressions, precedence, evaluation order and common undefined behavior pitfalls.
C has no formal declarative type; it has type declarations. See how struct, enum, typedef and function pointers are declared and read.
C11 _Atomic and <stdatomic.h> bring portable lock-free operations to C. See atomic counters, memory orders and compare-and-swap with complete examples.
The noexcept operator does not exist in C. It is a C++ feature, and C reports errors with return values, errno and out-parameters instead.
A compile-time constant in C is a value the compiler evaluates during translation. Learn why const is not enough and what to use instead.
User-defined literals do not exist in C. Learn the closest alternatives: named constants, inline functions, compound literals and _Generic.
C has no constructors, so constructor delegation does not exist. Reuse initialisation logic with a core init function, wrapper functions and designated initialisers.
C has no vtable, since vtables belong to C++ virtual functions. Learn how to get the same dynamic dispatch in C with structs of function pointers.
C has no vptr, but you can store a pointer to a shared function table in each object. Compare layouts and see how to use C++ objects from C.