Top "C" questions

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

How to link to a static library in C?

I use code::blocks to compile my static library. The output result is a libstatic.a file. Now, how do …

c build compilation static-libraries
Setting variable to NULL after free

In my company there is a coding rule that says, after freeing any memory, reset the variable to NULL. For …

c coding-style malloc free heap-memory
Should struct definitions go in .h or .c file?

I've seen both full definitions of structs in headers and just declarations—is there any advantage to one method over …

c header struct
What does WEXITSTATUS(status) return?

I am trying to understand how WEXITSTATUS(status) works. I have come across a piece of code where the return …

c unix signals posix fork
converting string to a double variable in C

I have written the following code. It should convert a string like "88" to double value 88 and print it void convertType(…

c string double atof
Windows threading: _beginthread vs _beginthreadex vs CreateThread C++

What's a better way to start a thread, _beginthread, _beginthreadx or CreateThread? I'm trying to determine what are the advantages/…

c++ c multithreading winapi
C libcurl get output into a string

I want to store the result of this curl function in a variable, how can I do so? #include <…

c libcurl
String termination - char c=0 vs char c='\0'

When terminating a string, it seems to me that logically char c=0 is equivalent to char c='\0', since …

c string c-strings null-terminated ansi-c
Why use apparently meaningless do-while and if-else statements in macros?

In many C/C++ macros I'm seeing the code of the macro wrapped in what seems like a meaningless do …

c++ c c-preprocessor c++-faq
Override a function call in C

I want to override certain function calls to various APIs for the sake of logging the calls, but I also …

c function linker overriding