Top "Libc" questions

The C standard library consists of a set of sections of the ISO C standard which describe a collection of headers and library routines used to implement common operations, such as input/output and string handling, in the C programming language.

C read file line by line

I wrote this function to read a line from a file: const char *readLine(FILE *file) { if (file == NULL) { printf("…

c file-io line libc
Are types like uint32, int32, uint64, int64 defined in any stdlib header?

I often see source code using types like uint32, uint64 and I wonder if they should be defined by the …

c libc
stdlib and colored output in C

I am making a simple application which requires colored output. How can I make my output colored like emacs and …

c colors stdio libc
Faster way to zero memory than with memset?

I learned that memset(ptr, 0, nbytes) is really fast, but is there a faster way (at least on x86)? I …

c libc
How can I link to a specific glibc version?

When I compile something on my Ubuntu Lucid 10.04 PC it gets linked against glibc. Lucid uses 2.11 of glibc. When I …

linux gcc linker glibc libc
What's the difference between hard and soft floating point numbers?

When I compile C code with my cross toolchain, the linker prints pages of warnings saying that my executable uses …

c linux floating-point arm libc
Why is there no strtoi in stdlib.h?

I have grown accustomed to strtod and variants. I am wondering why there is no strtoi shipped with stdlib.h. …

c libc
Is snprintf() ALWAYS null terminating?

Is snprintf always null terminating the destination buffer? In other words, is this sufficient: char dst[10]; snprintf(dst, sizeof (dst), "…

c posix libc
How to use debug version of libc

Short version of question: How can I get gdb to use the debugging symbols for libc? Longer version: I am …

linux gdb libc ldd
Get the time zone GMT offset in C

I'm using the standard mktime function to turn a struct tm into an epoch time value. The tm fields are …

c datetime timezone libc