Top "C" questions

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

How to use netlink socket to communicate with a kernel module?

I am trying to write a linux kernel module that communicates with user process using netlink. I am using netlink …

c linux-kernel linux-device-driver netlink
fgets to read line by line in files

I understand that fgets reads until EOF or a newline. I wrote a sample code to read lines from a …

c file-io fgets
What happens if I define a 0-size array in C/C++?

Just curious, what actually happens if I define a zero-length array int array[0]; in code? GCC doesn't complain at all. …

c++ c arrays
How do I check if an integer is even or odd using bitwise operators

How do I check if an integer is even or odd using bitwise operators

c bitwise-operators
How do you do non-blocking console I/O on Linux in C?

How do you do nonblocking console IO on Linux/OS X in C?

c linux macos io nonblocking
How do I read JPEG and PNG pixels in C++ on Linux?

I'm doing some image processing, and I'd like to individually read each pixel value in a JPEG and PNG images. …

c++ c linux png jpeg
Error Invalid use of void expression

I have a function int rt_task_start (RT_TASK *task, void(*task_func)(void *arg), void *arg) where in …

c xenomai
TCP Connect error 115 Operation in Progress What is the Cause?

My application creats a TCP connection, This is working normaly. But in one network server has many IP say 174.X.…

c networking tcp network-programming errno
How to check for signed integer overflow in C without undefined behaviour?

There's (1): // assume x,y are non-negative if(x > max - y) error; And (2): // assume x,y are non-negative int …

c integer-overflow
Printf a buffer of char with length in C

I have a buffer which I receive through a serial port. When I receive a certain character, I know a …

c buffer printf