Top "C" questions

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

Assign one struct to another in C

Can you assign one instance of a struct to another, like so: struct Test t1; struct Test t2; t2 = t1; …

c struct
What can cause a “Resource temporarily unavailable” on sock send() command

What can cause a Resource temporarily unavailable error on a socket send() command? The socket is setup as AF_UNIX, …

c linux sockets unix
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
Why does the arrow (->) operator in C exist?

The dot (.) operator is used to access a member of a struct, while the arrow operator (->) in C …

c pointers dereference
Convert RGB to Black & White in OpenCV

I would like to know how to convert an RGB image into a black & white (binary) image. After conversion, …

c++ c image-processing opencv computer-vision
How do I get DOUBLE_MAX?

AFAIK, C supports just a few data types: int, float, double, char, void enum. I need to store a number …

c double
Initializing a struct to 0

If I have a struct like this: typedef struct { unsigned char c1; unsigned char c2; } myStruct; What would be the …

c struct initialization
How to make child process die after parent exits?

Suppose I have a process which spawns exactly one child process. Now when the parent process exits for whatever reason (…

c linux unix process fork
How to use timer in C?

What is the method to use a timer in C? I need to wait until 500 ms for a job. Please …

c timer countdowntimer
Case Insensitive String comp in C

I have two postcodes char* that I want to compare, ignoring case. Is there a function to do this? Or …

c string standard-library