Top "C" questions

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

Why use double indirection? or Why use pointers to pointers?

When should a double indirection be used in C? Can anyone explain with a example? What I know is that …

c pointers
Create a pointer to two-dimensional array

I need a pointer to a static 2-dimensional array. How is this done? static uint8_t l_matrix[10][20]; void test(){ …

c arrays pointers
Arguments to main in C

I don't know what to do! I have a great understanding of C basics. Structures, file IO, strings, etc. Everything …

c command-line-arguments main-method
What is the symbol for whitespace in C?

I am trying to figure out how to check if a character is equal to white-space in C. I know …

c whitespace space
C programming: Dereferencing pointer to incomplete type error

I have a struct defined as: struct { char name[32]; int size; int start; int popularity; } stasher_file; and an array …

c struct dereference
Best way to check if a character array is empty

Which is the most reliable way to check if a character array is empty? char text[50]; if(strlen(text) == 0) {} or …

c arrays null char
How to write log base(2) in c/c++

Is there any way to write log(base 2) function? The C language has 2 built in function -->> 1.log …

c++ c
Finding the length of an integer in C

I would like to know how I can find the length of an integer in C. For instance: 1 => 1 25 => 2 12512 =&…

c integer digit
Why am I getting "undefined reference to sqrt" error even though I include math.h header?

I'm very new to C and I have this code: #include <stdio.h> #include <math.h> …

c linker linker-errors libm
Create a file if one doesn't exist - C

I want my program to open a file if it exists, or else create the file. I'm trying the following …

c fopen fclose freopen