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 behavior of integer division?

For example, int result; result = 125/100; or result = 43/100; Will result always be the floor of the division? What is the defined …

c math c99 c89 integer-division
How do you clear the console screen in C?

Is there a "proper" way to clear the console window in C, besides using system("cls")?

c windows console console-application
lvalue required as left operand of assignment

Why am I getting lvalue required as left operand of assignment with a single string comparison? How can I fix …

c lvalue strcmp
C pointer to array/array of pointers disambiguation

What is the difference between the following declarations: int* arr1[8]; int (*arr2)[8]; int *(arr3[8]); What is the general rule for …

c arrays pointers variable-declaration
How to empty a char array?

Have an array of chars like char members[255]. How can I empty it completely without using a loop? char members[255]; …

c arrays char
Is there a standard sign function (signum, sgn) in C/C++?

I want a function that returns -1 for negative numbers and +1 for positive numbers. http://en.wikipedia.org/wiki/Sign_…

c++ c math
What are .a and .so files?

I'm currently trying to port a C application to AIX and am getting confused. What are .a and .so files …

c unix compilation shared-libraries .a
Passing by reference in C

If C does not support passing a variable by reference, why does this work? #include <stdio.h> void …

c pointers pass-by-reference
Printing leading 0's in C?

I'm trying to find a good way to print leading 0's, such as 01001 for a zipcode. While the number would …

c printf
Can I use a binary literal in C or C++?

I need to work with a binary number. I tried writing: const x = 00010000; But it didn't work. I know that …

c++ c binary