Top "C" questions

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

gcc/g++: "No such file or directory"

g++ gives me errors of the form: foo.cc:<line>:<column>: fatal error: <bar>: …

c++ c gcc g++ c++-faq
How to get the real and total length of char * (char array)?

For a char [], I can easily get its length by: char a[] = "aaaaa"; int length = sizeof(a)/sizeof(char); // length=6 …

c++ c arrays pointers char
Passing an array by reference in C?

How can I pass an array of structs by reference in C? As an example: struct Coordinate { int X; int …

c arrays pass-by-reference
How I can print to stderr in C?

In C, Printing to stdout is easy, with printf from stdio.h. However, how can print to stderr? We can …

c printf stderr
Left-pad printf with spaces

How can I pad a string with spaces on the left when using printf? For example, I want to print "…

c formatting printf
How to correctly use the extern keyword in C

My question is about when a function should be referenced with the extern keyword in C. I am failing to …

c
Static linking vs dynamic linking

Are there any compelling performance reasons to choose static linking over dynamic linking or vice versa in certain situations? I've …

c++ c performance static-linking dynamic-linking
Reading file using fscanf() in C

I need to read and print data from a file. I wrote the program like below, #include<stdio.h&…

c file readfile scanf
Initializing entire 2D array with one value

With the following declaration int array[ROW][COLUMN]={0}; I get the array with all zeroes but with the following one …

c arrays initialization