🎯 Goal: Understand the basics of C programming and set up your development environment.
1️⃣ What is C Programming?
✅ C is a general-purpose, procedural programming language developed by Dennis Ritchie in 1972.
✅ It is used in operating systems (Linux, Windows), cybersecurity, embedded systems, and game development.
✅ C is known for speed, memory management, and direct hardware interaction, making it ideal for hacking and security research.
2️⃣ Setting Up the Development Environment
For Windows Users
- Download MinGW (GCC Compiler) → Link
- Install CodeBlocks IDE (optional) → Link
- Check installation:
- Open Command Prompt (cmd) and type:
gcc --version
- If installed, it should show the GCC version.
- Open Command Prompt (cmd) and type:
For Linux/Mac Users
- Open Terminal and install GCC:
sudo apt update && sudo apt install gcc # For Ubuntu/Debian sudo dnf install gcc # For Fedora
- Verify installation:
gcc --version
3️⃣ Writing Your First C Program
🔹 “Hello, World!” Program
Open a text editor (VS Code, CodeBlocks, or Terminal) and type:
#include <stdio.h> // Standard Input/Output library
int main() {
printf("Hello, World!\n"); // Print output to screen
return 0; // Exit the program
}
🔹 Explanation:
#include <stdio.h>
→ Includes the Standard Input/Output library.int main()
→ Entry point of every C program.printf("Hello, World!\n");
→ Prints text to the screen.return 0;
→ Ends the program successfully.
4️⃣ Compiling and Running the Program
🔹 For Windows (CMD or PowerShell)
- Open the folder where your C file is saved (
cd path/to/folder
). - Compile the program:
gcc hello.c -o hello.exe
- Run it:
hello.exe
🔹 For Linux/Mac (Terminal)
- Navigate to the folder:
cd path/to/folder
- Compile:
gcc hello.c -o hello
- Run:
./hello
5️⃣ Hands-on Practice
✅ Modify the program to print your name:
#include <stdio.h>
int main() {
printf("Hello, I am [Your Name]!\n");
return 0;
}
✅ Try printing multiple lines:
#include <stdio.h>
int main() {
printf("Learning C is fun!\n");
printf("I will become a cybersecurity expert!\n");
return 0;
}
🔹 What’s Next (Day 2)?
➡️ Learn about Variables, Data Types, and Operators in C.
Let me know if you need help setting up your environment! 🚀
0 Comments