Top "C" questions

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

Strip first and last character from C string

I have a C string that looks like "Nmy stringP", where N and P can be any character. How can …

c string c-strings
Where does gcc look for C and C++ header files?

On a Unix system, where does gcc look for header files? I spent a little time this morning looking for …

c gcc header
When is assembly faster than C?

One of the stated reasons for knowing assembler is that, on occasion, it can be employed to write code that …

c performance assembly
How can I convert a file pointer ( FILE* fp ) to a file descriptor (int fd)?

I have a FILE *, returned by a call to fopen(). I need to get a file descriptor from it, to …

c linux unix file posix
How to convert enum names to string in c

Is there a possibility to convert enumerator names to string in C?

c string enums
How to convert C++ Code to C

I have some C++ code. In the code there are many classes defined, their member functions, constructors, destructors for those …

c++ c code-translation
UNIX nonblocking I/O: O_NONBLOCK vs. FIONBIO

In every example and discussion I run across in the context of BSD socket programming, it seems that the recommended …

c network-programming unix sockets
Invalid application of sizeof to incomplete type with a struct

I have a struct where I put all the information about the players. That's my struct: struct player{ int startingCapital; …

c struct calloc
Is there a way to specify how many characters of a string to print out using printf()?

Is there a way to specify how many characters of a string to print out (similar to decimal places in …

c++ c printf
Does Arduino use C or C++?

Coming from Python, the whole C/C++ thing is kind of alien to begin with... and then I see in …

c++ c arduino