Top "C" questions

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

Overloading Macro on Number of Arguments

I have two macros FOO2 and FOO3: #define FOO2(x,y) ... #define FOO3(x,y,z) ... I want to define …

c macros c-preprocessor
What is the size of void?

What would this statement yield? void *p = malloc(sizeof(void)); Edit: An extension to the question. If sizeof(void) yields 1 …

c++ c language-lawyer sizeof
Using getchar() on c gets the 'Enter' after input

I'm trying to write a simple program that asks a user to choose from a menu in a loop. I …

c getchar
C pointers : pointing to an array of fixed size

This question goes out to the C gurus out there: In C, it is possible to declare a pointer as …

c pointers size
Is it safe to return a struct in C or C++?

What I understand is that this shouldn't be done, but I believe I've seen examples that do something like this (…

c++ c function struct return-type
How to convert Char into Float

How to convert an unsigned char value into a float or double in coding in AVR studio 4.? Please help I …

c++ c microcontroller atmega16 avr-studio4
C , how to create thread using pthread_create function

I'm making a c file for a dispatch queue that gets a task and put it in to a queue …

c multithreading function pthreads createthread
How to get the number of CPUs in Linux using C?

Is there an API to get the number of CPUs available in Linux? I mean, without using /proc/cpuinfo or …

c linux multithreading cpu processor
C represent int in base 2

Possible Duplicate: Can I use a binary literal in C or C++? I am learning C and i recently found …

c binary integer representation
fast & efficient least squares fit algorithm in C?

I am trying to implement a linear least squares fit onto 2 arrays of data: time vs amplitude. The only technique …

c algorithm least-squares