Top "C" questions

C is a general-purpose programming language used for system programming (OS and embedded), libraries, games and cross-platform.

Getting terminal width in C?

I've been looking for a way to get the terminal width from within my C program. What I keep coming …

c linux terminal width
How do I determine the number of digits of an integer in C?

for instance, n = 3432, result 4 n = 45, result 2 n = 33215, result 5 n = -357, result 3 I guess I could just turn it into a …

c math
why is u8 u16 u32 u64 used instead of unsigned int in kernel programming

I see u8 u16 u32 u64 data types being used in kernel code. And I am wondering why is there …

c linux kernel linux-device-driver
Address family not supported by protocol

Following code is a socket programming sample for a TCP client. But when I run this, connect() is returned as …

c sockets centos ipv6
printf string, variable length item

#define SIZE 9 int number=5; char letters[SIZE]; /* this wont be null-terminated */ ... char fmt_string[20]; sprintf(fmt_string, "%%d %%%ds", SIZE); /* …

c format printf
What is the difference between C, C99, ANSI C and GNU C?

I have started programming practice on codechef and have been confused by the difference between C and C99. What does …

c gcc c99 c89 ansi-c
What does tilde(~) operator do?

I recently saw the above operator in a code,I googled for it but found nothing.The code is below.…

c cryptography
What exactly is a reentrant function?

Most of the times, the definition of reentrance is quoted from Wikipedia: A computer program or routine is described as …

c++ c recursion thread-safety reentrancy
how to take integers as command line arguments?

I've read a getopt() example but it doesn't show how to accept integers as argument options, like cvalue would be …

c command-line-arguments getopt
Using C++ library in C code

I have a C++ library that provides various classes for managing data. I have the source code for the library. …

c++ c gcc glibc