Top "C" questions

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

How to use /dev/random or urandom in C?

I want to use /dev/random or /dev/urandom in C. How can I do it? I don't know how …

c linux random
Finding out what the GCC include path is

I'm trying to programmatically find the #include path on Linux, which as I understand it, in practice means finding what …

c linux gcc c-preprocessor
Pointer Arithmetic

Does anyone have any good articles or explanations (blogs, examples) for pointer arithmetic? Figure the audience is a bunch of …

c pointers pointer-arithmetic
Significance of -pthread flag when compiling

In various multi threaded C and C++ projects I've seen the -pthread flag applied to both the compiling and linking …

c++ c linux pthreads
How detect current screen resolution?

How do I from Winapi (in C or C++) detect the current screen resolution? Some background: I want to start …

c++ c winapi api resolution
Passing a structure through Sockets in C

I am trying to pass whole structure from client to server or vice-versa. Let us assume my structure as follows …

c sockets recv sendto
How to make a structure extern and define its typedef

I'm trying to implement tree algorithms in C. I have declared a extern struct in a header file that is …

c extern structure
Variable declaration placement in C

I long thought that in C, all variables had to be declared at the beginning of the function. I know …

c declaration c89
How do I show what fields a struct has in GDB?

I came upon a struct (called ngx_http_variable_value_t) in my GDB (debugger) session and I would like …

c gdb
pthread_create and passing an integer as the last argument

I have the following functions : void *foo(void *i) { int a = (int) i; } int main() { pthread_t thread; int i; …

c pthreads