c_programming_notes
c_programming_notes
1. Introduction to C
Ritchie. It provides low-level access to memory and is widely used for system/software
development.
#include <stdio.h>
int main() {
printf("Hello, World!\n");
return 0;
3. Data Types in C
4. Control Structures
5. Functions
return_type function_name(parameters) {
// body
}
6. Pointers
A pointer is a variable that stores the memory address of another variable. Use * for value at
Array is a collection of elements of the same type. Strings are arrays of characters ending with a null
character '\0'.
8. Structures
Structures are user-defined data types that group related variables of different types. Syntax:
struct StructName {
int a;
char b;
};
9. File Handling
C provides functions like fopen, fclose, fprintf, fscanf for file operations. Modes include "r", "w", "a",
"r+", etc.