Top "C" questions

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

Check value of least significant bit (LSB) and most significant bit (MSB) in C/C++

I need to check the value of the least significant bit (LSB) and most significant bit (MSB) of an integer …

c++ c integer bit-manipulation bit
Program received signal SIGTRAP, Trace/breakpoint trap

I'm debugging a piece of (embedded) software. I've set a breakpoint on a function, and for some reason, once I've …

c gdb embedded arm
Where are constant variables stored in C?

I wonder where constant variables are stored. Is it in the same memory area as global variables? Or is it …

c variables memory-management constants globals
How to capture Control+D signal?

I want to capture the Ctrl+D signal in my program and write a signal handler for it. How can …

c linux unix signals
What is the difference between memmove and memcpy?

What is the difference between memmove and memcpy? Which one do you usually use and how?

c memcpy memmove
PTHREAD_MUTEX_INITIALIZER vs pthread_mutex_init ( &mutex, param)

Is there any difference between pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; Or pthread_mutex_t lock; pthread_mutex_init ( &…

c ubuntu pthreads mutex
How to write iOS app purely in C

I read here Learn C Before Objective-C? Usually I then replace some Obj-C code with pure C code (after all …

objective-c ios c cocoa-touch objective-c-runtime
How to compile C code with anonymous structs / unions?

I can do this in c++/g++: struct vec3 { union { struct { float x, y, z; }; float xyz[3]; }; }; Then, vec3 v; …

c++ c struct anonymous unions
What does fflush(stdin) do in C programing?

I am very new to C programming and I am trying to understand how fflush(stdin) really works. In the …

c operating-system signals
How come an array's address is equal to its value in C?

In the following bit of code, pointer values and pointer addresses differ as expected. But array values and addresses don't! …

c pointers arrays