Top "C" questions

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

What is the difference between float and double?

I've read about the difference between double precision and single precision. However, in most cases, float and double seem to …

c++ c floating-point precision
How to convert a string to integer in C?

I am trying to find out if there is an alternative way of converting string to integer in C. I …

c string atoi
How to convert integer to string in C?

I tried this example: /* itoa example */ #include <stdio.h> #include <stdlib.h> int main () { int i; …

c string integer type-conversion
max value of integer

In C, the integer (for 32 bit machine) is 32 bits, and it ranges from -32,768 to +32,767. In Java, the integer(long) …

java c integer max bit
How can I get the list of files in a directory using C or C++?

How can I determine the list of files in a directory from inside my C or C++ code? I'm not …

c++ c file directory
What does "static" mean in C?

I've seen the word static used in different places in C code; is this like a static function/class in …

c syntax static
C read file line by line

I wrote this function to read a line from a file: const char *readLine(FILE *file) { if (file == NULL) { printf("…

c file-io line libc
Is there a printf converter to print in binary format?

I can print with printf as a hex or octal number. Is there a format tag to print as binary, …

c printf
What is the effect of extern "C" in C++?

What exactly does putting extern "C" into C++ code do? For example: extern "C" { void foo(); }

c++ c linkage name-mangling extern-c
How to initialize a struct in accordance with C programming language standards

I want to initialize a struct element, split in declaration and initialization. This is what I have: typedef struct MY_…

c struct initialization