Top "C" questions

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

Switch statement: must default be the last case?

Consider the following switch statement: switch( value ) { case 1: return 1; default: value++; // fall-through case 2: return value * 2; } This code compiles, but is …

c switch-statement
Integer to IP Address - C

I'm preparing for a quiz, and I have a strong suspicion I may be tasked with implementing such a function. …

c string ip-address
printf, wprintf, %s, %S, %ls, char* and wchar*: Errors not announced by a compiler warning?

I have tried the following code: wprintf(L"1 %s\n","some string"); //Good wprintf(L"2 %s\n",L"some string"); //…

c mingw
"register" keyword in C?

What does the register keyword do in C language? I have read that it is used for optimizing but is …

c memory keyword
error C4996: 'scanf': This function or variable may be unsafe in c programming

I have created a small application to find max number by using user-defined function with parameter. When I run it, …

c windows visual-studio c11 tr24731
Can I display the value of an enum with printf()?

Is there a one-liner that lets me output the current value of an enum?

c printf enums
Why is C so fast, and why aren't other languages as fast or faster?

In listening to the StackOverflow podcast, the jab keeps coming up that "real programmers" write in C, and that C …

c performance
How to compile and run C in sublime text 3?

I would like to compile and run C program in sublime text 3 on ubuntu 14.04. Currently the program is being compiled …

c gcc sublimetext3 ubuntu-14.04
Variably modified array at file scope

I want to create a constant static array to be used throughout my Objective-C implementation file similar to something like …

c objective-c arrays static constants
Best practices for circular shift (rotate) operations in C++

Left and right shift operators (<< and >>) are already available in C++. However, I couldn't find out …

c++ c rotation bit-manipulation c++-faq