Top "C" questions

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

How do I get bit-by-bit data from an integer value in C?

I want to extract bits of a decimal number. For example, 7 is binary 0111, and I want to get 0 1 1 1 all bits …

c bit-manipulation
How to set socket timeout in C when making multiple connections?

I'm writing a simple program that makes multiple connections to different servers for status check. All these connections are constructed …

c linux sockets
Convert Little Endian to Big Endian

I just want to ask if my method is correct to convert from little endian to big endian, just to …

c endianness
How to suppress "unused parameter" warnings in C?

For instance: Bool NullFunc(const struct timespec *when, const char *who) { return TRUE; } In C++ I was able to put …

c gcc gcc-warning
How to allocate aligned memory only using the standard library?

I just finished a test as part of a job interview, and one question stumped me, even using Google for …

c memory-management
print call stack in C or C++

Is there any way to dump the call stack in a running process in C or C++ every time a …

c++ c linux callstack
How can one see content of stack with GDB?

I am new to GDB, so I have some questions: How can I look at content of the stack? Example: …

c assembly gdb
How to work with complex numbers in C?

How can I work with complex numbers in C? I see there is a complex.h header file, but it …

c complex-numbers
Warning comparison between pointer and integer

I am getting a warning when I iterate through the character pointer and check when the pointer reaches the null …

c null-terminated
Passing command line arguments in Visual Studio 2010?

I am working on a C project and can not figure out how to pass command line arguments to my …

c visual-studio-2010 visual-studio command-line-arguments