Codcups Logo

Codcups

Complete C Programming Reference

C Programming Complete Notes

C Language — Developed by Dennis Ritchie in 1972 at Bell Laboratories. Often called the "mother of all programming languages."

01. C Language Basics

C is a general-purpose, procedural programming language that provides low-level memory access with a simple syntax. It forms the foundation of many modern languages including C++, Java, and Python.

Why C Matters? Every major operating system (Windows, Linux, macOS) has significant portions written in C. It gives you complete control over system resources.

Basic Structure of a C Program

#include <stdio.h>

int main() {
    printf("Hello, World!");
    return 0;
}
Program Explanation:

02. C Keywords (32 Total)

Complete List of C Keywords
KeywordDescription
autoDeclares automatic (local) variable
breakExits a loop or switch
caseDefines a block in switch-case
charCharacter data type
constDeclares constant value
continueSkips current iteration in loop
defaultDefines default case in switch
doStarts a do-while loop
doubleDouble-precision float
elseAlternate block in if-else
enumDeclares enumerated type
externDeclares external variable or function
floatFloating-point variable
forStarts a for loop
gotoJumps to a label
ifConditional branching
intDeclares integer variable
longDeclares long integer
registerDeclares register variable
returnReturns from a function
shortDeclares short integer
signedSigned data type modifier
sizeofReturns size of data type
staticStatic storage class
structDeclares structure
switchSwitch-case control
typedefDefines new type name
unionDeclares union
unsignedUnsigned data type modifier
voidDeclares empty return type
volatileTells compiler not to optimize
whileStarts a while loop
Note: All keywords are reserved words in C. You cannot use them as variable names or identifiers.

03. Data Types

Basic & Derived Data Types
Data TypeDescriptionSize (bytes)
intInteger4
charCharacter1
floatFloating point4
doubleDouble-precision float8
voidNo value-
shortShort integer2
longLong integer4 or 8
signedSigned type-
unsignedUnsigned type-
// Example of different data types
int age = 25;
float price = 99.99;
char grade = 'A';
double pi = 3.14159265359;

04. Operators

C Operators Reference
Operator TypeSymbols
Arithmetic+ - * / %
Relational== != > < >= <=
Logical&& || !
Assignment= += -= *= /= %=
Bitwise& | ^ ~ << >>
Increment/Decrement++ --
Conditional? :
Comma,
Sizeofsizeof()
Pointer* &
Member Access. ->

Arithmetic

Basic math operations: + - * / %

Relational

Comparisons: == != < > <= >=

Logical

Boolean logic: && (AND), || (OR), ! (NOT)

05. Escape Sequences

Escape Codes
Escape CodeMeaning
\nNewline
\tTab
\\Backslash (\)
\"Double quote (")
\'Single quote (')
\rCarriage return
\bBackspace
\fForm feed
\aAlert (beep)
\vVertical tab
\0Null character
// Escape sequence example
printf("Hello\nWorld\tTabbed\n");
printf("Path: C:\\Program Files\\\n");
printf("She said, \"Hello!\"");

06. Special Symbols

Special Characters
SymbolPurpose
;Statement terminator
{ }Block start and end
( )Function and condition grouping
[ ]Array subscript
#Preprocessor directive
*Pointer, multiplication
&Address of operator
->Access struct member via pointer
.Access struct member
Pro Tips:
Back to Notes Page