Top "C" questions

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

How to compile C program on command line using MinGW?

What command does one have to enter at the command line in Windows 7 to compile a basic C program? Like …

c windows gcc command-line mingw
What is a difference between unsigned int and signed int in C?

Consider these definitions: int x=5; int y=-5; unsigned int z=5; How are they stored in memory? Can anybody explain …

c unsigned-integer signed-integer
Floating point exception( core dump

Program: So I made a program that take two numbers, N and L. N is the size of a 2D …

c coredump
What do .c and .h file extensions mean to C?

It's all in the title; super-simple I reckon, but it's so hard to search for syntactical things anywhere. These are …

c file-type cs50
Default values in a C Struct

I have a data structure like this: struct foo { int id; int route; int backup_route; int current_route; } and …

c initialization
Get IP address of an interface on Linux

How can I get the IPv4 address of an interface on Linux from C code? For example, I'd like to …

c linux sockets
What are the rules for casting pointers in C?

K&R doesn't go over it, but they use it. I tried seeing how it'd work by writing an …

c pointers casting
Rounding integer division (instead of truncating)

I was curious to know how I can round a number to the nearest whole number. For instance, if I …

c math int rounding integer-division
_DEBUG vs NDEBUG

Which preprocessor define should be used to specify debug sections of code? Use #ifdef _DEBUG or #ifndef NDEBUG or is …

c++ c debugging
How do I check OS with a preprocessor directive?

I need my code to do different things based on the operating system on which it gets compiled. I'm looking …

c operating-system c-preprocessor conditional-compilation