Top "C" questions

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

Why is “while ( !feof (file) )” always wrong?

I've seen people trying to read files like this in a lot of posts lately: #include <stdio.h> #…

c file while-loop eof feof
Efficient Algorithm for Bit Reversal (from MSB->LSB to LSB->MSB) in C

What is the most efficient algorithm to achieve the following: 0010 0000 => 0000 0100 The conversion is from MSB->LSB to LSB-&…

c algorithm bit-manipulation
Print the address or pointer for value in C

I want to do something that seems fairly simple. I get results but the problem is, I have no way …

c pointers memory-address
how to get thread id of a pthread in linux c program?

In linux c program, how to print thread id of a thread created by pthread library? for ex: we can …

c linux pthreads
how does array[100] = {0} set the entire array to 0?

How does the compiler fill values in char array[100] = {0};? What's the magic behind it? I wanted to know how internally …

c++ c compiler-construction
Modulo operation with negative numbers

In a C program i was trying the below operations(Just to check the behavior ) x = 5 % (-3); y = (-5) % (3); z = (…

c gcc modulo
How to set up a cron job to run an executable every hour?

I need to set up a cron job that runs an executable compiled using gcc once every hour. I logged …

c linux gcc cron crontab
Source file not compiled Dev C++

I just installed Dev C++ and I am learning C programming. the code i used was #include <stdio.h&…

c dev-c++
How do you convert a byte array to a hexadecimal string in C?

I have: uint8 buf[] = {0, 1, 10, 11}; I want to convert the byte array to a string such that I can print the …

c string hex
Difference between static and shared libraries?

What is the difference between static and shared libraries? I use Eclipse and there are several project types including Static …

c++ c shared-libraries static-libraries