Top "C" questions

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

Removing Spaces from a String in C?

What is the easiest and most efficient way to remove spaces from a string in C?

c string spaces
How to scanf only integer?

I want the code to run until the user enters an integer value. The code works for char and char …

c scanf
static const vs #define

Is it better to use static const vars than #define preprocessor? Or maybe it depends on the context? What are …

c++ c constants
What is the meaning of "__attribute__((packed, aligned(4))) "

It is C language.It is written that: typedef struct __attribute__((packed, aligned(4))) Ball { float2 delta; float2 position; //float3 color; …

c gcc
How to repeat a char using printf?

I'd like to do something like printf("?", count, char) to repeat a character count times. What is the right format-string …

c printf
What's the difference between "static" and "static inline" function?

IMO both make the function to have a scope of the translation unit only. What's the difference between "static" and "…

c inline
Cannot assign requested address - possible causes?

I have a program that consists of a master server and distributed slave servers. The slave servers send status updates …

c sockets tcp errno
How to print variable addresses in C?

When i run this code. #include <stdio.h> void moo(int a, int *b); int main() { int x; …

c pointers memory-address
How to calculate the CPU usage of a process by PID in Linux from C?

I want to programmatically [in C] calculate CPU usage % for a given process ID in Linux. How can we get …

c linux cpu-usage
How do I work with dynamic multi-dimensional arrays in C?

Does someone know how I can use dynamically allocated multi-dimensional arrays using C? Is that possible?

c arrays dynamic