Top "C" questions

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

Detecting CPU architecture compile-time

What is the most reliable way to find out CPU architecture when compiling C or C++ code? As far as …

c++ c detection cpu-architecture compile-time
What's the escape sequence for blanks in C?

I'm writing a program to count blanks, tabs, and newlines. I remember what the escape sequence for tabs and newlines …

c escaping whitespace space kernighan-and-ritchie
undefined reference to curl_global_init, curl_easy_init and other function(C)

I am trying to use Curl in C. I visited Curl official page, and copied sample source code. below is …

c curl libcurl
Aligning to cache line and knowing the cache line size

To prevent false sharing, I want to align each element of an array to a cache line. So first I …

c linux caching computer-architecture memory-alignment
How to include needed C library using gcc?

I am trying to compile the simple C example from this Tutorial on Ubuntu using gcc. What do I have …

c linux gcc indicator
What exactly does fork return?

On success, the PID of the child process is returned in the parent’s thread of execution, and a 0 is …

c linux fork
How does free know how much to free?

In C programming, you can pass any kind of pointer you like as an argument to free, how does it …

c size pointers free
Writing Structs to a file in c

Is it possible to write an entire struct to a file example: struct date { char day[80]; int month; int year; };

c file-io structure
How to read, understand, analyze, and debug a Linux kernel panic?

Consider the following linux kernel dump stack trace, you can trigger a panic from the kernel source code by calling …

c linux debugging linux-kernel panic
How to share semaphores between processes using shared memory

I have to synchronize N client processes with one server. These processes are forked by a main function in which …

c synchronization client-server semaphore shared