Top "C" questions

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

How to printf uint64_t? Fails with: "spurious trailing ‘%’ in format"

I wrote a very simple test code of printf uint64_t: #include <inttypes.h> #include <stdio.h&…

c++ c
Error handling in C code

What do you consider "best practice" when it comes to error handling errors in a consistent way in a C …

c error-handling
With arrays, why is it the case that a[5] == 5[a]?

As Joel points out in Stack Overflow podcast #34, in C Programming Language (aka: K & R), there is mention of …

c arrays pointers pointer-arithmetic
Preprocessor check if multiple defines are not defined

I have a selection of #defines in a header that are user editable and so I subsequently wish to check …

c c-preprocessor
How to find the socket connection state in C?

I have a TCP connection. Server just reads data from the client. Now, if the connection is lost, the client …

c network-programming
How do get numbers to display as two digits in C?

For C programming. How do i get numbers to be displayed as 00, 01, 02, 03, instead of 0, 1, 2, 3. I just need 0 before the number …

c digit
Variable declaration in a header file

In case I have a variable that may be used in several sources - is it a good practice to …

c header
What is the Difference Between read() and recv() , and Between send() and write()?

What is the difference between read() and recv(), and between send() and write() in socket programming in terms of performances, …

c sockets unix network-programming posix
How to change text color and console color in code::blocks?

I am writing a program in C. I want to change the text color and background color in the console. …

c++ c gcc colors codeblocks
A Simple, 2d cross-platform graphics library for c or c++?

As in title, i need a 2d graphics library that is cross-platform, and provides simple functions, like in Basic; essentially, …

c graphics cross-platform