Top "C" questions

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

How to disable GCC warnings for a few lines of code

In Visual C++, it's possible to use #pragma warning (disable: ...). Also I found that in GCC you can override per …

c gcc compiler-warnings pragma
How do I measure a time interval in C?

I would like to measure time in C, and I am having a tough time figuring it out, all I …

c timer
Speed comparison with Project Euler: C vs Python vs Erlang vs Haskell

I have taken Problem #12 from Project Euler as a programming exercise and to compare my (surely not optimal) implementations in …

python c performance haskell erlang
Color text in terminal applications in UNIX

I started to write a terminal text editor, something like the first text editors for UNIX, such as vi. My …

c unix terminal
Writing BMP image in pure c/c++ without other libraries

In my algorithm, I need to create an information output. I need to write a boolean matrix into a bmp …

c++ c image graphics bmp
Undefined reference to `sin`

I have the following code (stripped down to the bare basics for this question): #include<stdio.h> #include&…

c math linker-errors undefined-reference
Why do I get "a label can only be part of a statement and a declaration is not a statement" if I have a variable that is initialized after a label?

I have the following simplified code: #include <stdio.h> int main () { printf("Hello "); goto Cleanup; Cleanup: char *str = "…

c gcc
Can I get Unix's pthread.h to compile in Windows?

If I try to compile a program with #include <pthread.h> in it, I get the error: pthread.…

c windows multithreading pthreads
Where do I find the current C or C++ standard documents?

For many questions the answer seems to be found in "the standard". However, where do we find that? Preferably online. …

c++ c standards c++-faq
How do I print the percent sign(%) in c

I am a beginner in C, and I was wondering why this program does not print % sign? The code is: #…

c operators percentage