Top "C" questions

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

"Multiple definition", "first defined here" errors

I have 3 projects: Server, Client and Commons. Making header & source pairs in Commons doesn't cause any problems and I …

c eclipse include definition multiple-definition-error
Why do you have to link the math library in C?

If I include <stdlib.h> or <stdio.h> in a C program I don't have to …

c compilation math.h
How can you flush a write using a file descriptor?

It turns out this whole misunderstanding of the open() versus fopen() stems from a buggy I2C driver in the …

c linux stdio i2c
How to avoid pressing Enter with getchar() for reading a single character only?

In the next code: #include <stdio.h> int main(void) { int c; while ((c=getchar())!= EOF) putchar(c); …

c input character getchar unbuffered
How to read numbers separated by space using scanf

I want to read numbers(integer type) separated by spaces using scanf() function. I have read the following: C, reading …

c input file-io scanf
What does this GCC error "... relocation truncated to fit..." mean?

I am programming the host side of a host-accelerator system. The host runs on the PC under Ubuntu Linux and …

c eclipse memory-management gcc embedded
Are global variables bad?

In C/C++, are global variables as bad as my professor thinks they are?

c++ c global-variables
Why does the C preprocessor interpret the word "linux" as the constant "1"?

Why does the C preprocessor in GCC interpret the word linux (small letters) as the constant 1? test.c: #include <…

c linux gcc c-preprocessor
Auto-indent spaces with C in vim?

I've been somewhat spoiled using Eclipse and java. I started using vim to do C coding in a linux environment, …

c vim coding-style vi
Fastest way to zero out a 2d array in C?

I want to repeatedly zero a large 2d array in C. This is what I do at the moment: // Array …

c arrays multidimensional-array zero memset