Top "C" questions

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

Find most significant bit (left-most) that is set in a bit array

I have a bit array implementation where the 0th index is the MSB of the first byte in an array, …

c bit-manipulation 32-bit
Initialization discards qualifiers from pointer target type

I'm trying to print the list of a singly linked list that I referred to in link text. It works, …

c linked-list
How do I make Makefile to recompile only changed files?

I have been struggling a bit to get make to compile only the files that have been edited. However I …

c makefile recompile
Is there an interpreter for C?

I was wondering if there is something like an interpreter for C. That is, in a Linux terminal I can …

c interpreter read-eval-print-loop
How to print a null-terminated string with newlines without showing backslash escapes in gdb?

I have a variable char* x = "asd\nqwe\n ... " and I want to print it with newlines printed as newlines …

c debugging gdb
faster alternative to memcpy?

I have a function that is doing memcpy, but it's taking up an enormous amount of cycles. Is there a …

c performance memcpy
memset() or value initialization to zero out a struct?

In Win32 API programming it's typical to use C structs with multiple fields. Usually only a couple of them have …

c++ c visual-c++ struct initialization
Cast to int vs floor

Is there any difference between these: float foo1 = (int)(bar / 3.0); float foo2 = floor(bar / 3.0); As I understand both cases have …

c++ c floating-point
What is the simplest way of getting user input in C?

There seem to be a LOT of ways you can get user input in C. What is the easiest way …

c input io scanf
EXIT_FAILURE vs exit(1)?

What's the difference? Which is preferred, or when should I use each one respectively?

c exit