Top "C" questions

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

Correct format specifier to print pointer or address?

Which format specifier should I be using to print the address of a variable? I am confused between the below …

c pointers format memory-address
What is a "callback" in C and how are they implemented?

From the reading that I have done, Core Audio relies heavily on callbacks (and C++, but that's another story). I …

c callback
Return a `struct` from a function in C

Today I was teaching a couple of friends how to use C structs. One of them asked if you could …

c
Structure padding and packing

Consider: struct mystruct_A { char a; int b; char c; } x; struct mystruct_B { int b; char a; } y; The …

c struct structure padding packing
How to get the current directory in a C program?

I'm making a C program where I need to get the directory that the program is started from. This program …

c unix working-directory
Reading in double values with scanf in c

I try to read-in 2 values using scanf() in C, but the values the system writes into memory are not equal …

c scanf conversion-specifier
Size of character ('a') in C/C++

What is the size of character in C and C++ ? As far as I know the size of char is 1 …

c++ c types
Finding the length of a Character Array in C

What is a way in C that someone could find the length of a character array? I will happily accept …

arrays c strlen
How to escape the % (percent) sign in C's printf?

How do you escape the % sign when using printf in C? printf("hello\%"); /* not like this */

c printf format-string
How can I do GUI programming in C?

I want to do Graphics programming in C. I had searched a lot about the compiler that provides a rich …

c windows user-interface graphics