Top "C" questions

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

How to concatenate two integers in C

Stack Overflow has this question answered in many other languages, but not C. So I thought I'd ask, since I …

c math optimization mathematical-optimization
Why won't extern link to a static variable?

Why does extern int n not compile when n is declared (in a different file) static int n, but works …

c static extern
Using Dynamic Memory allocation for arrays

How am I supposed to use dynamic memory allocations for arrays? For example here is the following array in which …

c arrays memory dynamic-memory-allocation
SImple C Program opening a file

I'm trying to make a program to open a file, called "write.txt". #include <stdio.h> main() { FILE *…

c fopen
How to create a new instance of a struct in C

In C, when you define a struct. What is the correct way to create a new instance? I've seen two …

c struct instance
Ctrl + C interrupt event handling in Linux

I am developing an application that uses C++ and compiles using Linux GNU C Compiler. I want to invoke a …

c++ c linux operating-system signals
C/C++: Force Bit Field Order and Alignment

I read that the order of bit fields within a struct is platform specific. What about if I use different …

c++ c bit-manipulation endianness bit
Convert ASM to C (not reverse engineer)

I googled and I see a surprising amount of flippant responses basically laughing at the asker for asking such a …

c assembly embedded reverse-engineering microchip
How to set up libusb on Mac OS X?

I'd like to try to make a user-space device driver using libusb on Mac, but I'm confused where to start. …

c macos macports libusb
Long Vs. Int C/C++ - What's The Point?

As I've learned recently, a long in C/C++ is the same length as an int. To put it simply, …

c++ c integer long-integer