Top "C" questions

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

Still Reachable Leak detected by Valgrind

All the functions mentioned in this block are library functions. How can I rectify this memory leak? It is listed …

c pthreads valgrind
Is there a performance difference between i++ and ++i in C?

Is there a performance difference between i++ and ++i if the resulting value is not used?

c performance optimization post-increment pre-increment
How to work with string fields in a C struct?

I'm having trouble making a database based on a singly-linked list in C, not because of the linked list concept …

c string linked-list structure
How to make a char string from a C macro's value?

For example, how to avoid writing the 'func_name' twice? #ifndef TEST_FUN # define TEST_FUN func_name # define TEST_…

c c-preprocessor dry
Why do I have to define LD_LIBRARY_PATH with an export every time I run my application?

I have some code that uses some shared libraries (c code on gcc). When compiling I have to explicitly define …

c linux gcc shared-libraries ld
Retrieve filename from file descriptor in C

Is it possible to get the filename of a file descriptor (Linux) in C?

c linux file file-descriptor
double free or corruption (!prev) error in c program

I get the following error when running a c program: *** glibc detected *** ./a.out: double free or corruption (!prev): 0x080…

c free
What is __stdcall?

I'm learning about Win32 programming, and the WinMain prototype looks like: int WINAPI WinMain ( HINSTANCE instance, HINSTANCE prev_instance, PSTR …

c winapi calling-convention stdcall
What is a file with extension .a?

I downloaded this: https://github.com/mongodb/mongo-c-driver And now I'm trying to use it inside my C program, but …

c gcc shared-libraries
What is more efficient? Using pow to square or just multiply it with itself?

What of these two methods is in C more efficient? And how about: pow(x,3) vs. x*x*x // etc?

c++ c optimization