Subscribe once and get notified the moment something relevant to your career is published. No spam, no noise.
Start your programming journey with one of the most powerful and foundational languages — C. This comprehensive course is designed for absolute beginners as well as intermediate learners who want to build a solid understanding of programming using the C language. Whether you're preparing for college-level programming, cracking technical interviews, or planning to explore systems or embedded development, this course covers everything step-by-step. Through hands-on examples, real-world practice problems, and structured explanations, you’ll learn how to write clean and efficient C code — from your first printf() to advanced data structures and memory management.
Before a C program is compiled, it is passed through a preprocessor. This preprocessor handles directives that begin with the # symbol, such as #include, #define, and #ifdef. These directives allow you to manage files, define constants, create macros, and write conditional compilation logic.
#include: Includes a header file#define: Defines a constant or macro#undef: Undefines a macro#ifdef: Checks if a macro is defined#ifndef: Checks if a macro is not defined#endif: Ends conditional directive#if, #else, #elif: Conditional compilation#define PI 3.14159
#define SITE "https://udaanpath.com"
int main() {
printf("Welcome to %s\n", SITE);
printf("Area of circle: %f\n", PI * 2 * 2);
return 0;
}
#define SQUARE(x) ((x) * (x))
int main() {
printf("Square of 5: %d\n", SQUARE(5)); // Output: 25
}
Note: Always use parentheses in macro definitions to avoid unexpected behaviors.
#define DEBUG
int main() {
#ifdef DEBUG
printf("Debug mode ON\n");
#endif
printf("Running program...\n");
}
Let’s say you want to print test logs only during development at UdaanPath:
#define DEV_MODE
int main() {
#ifdef DEV_MODE
printf("🧪 Running test logs...\n");
#endif
printf("Welcome to UdaanPath!\n");
}
#define SITE "UdaanPath"
#undef SITE
#define SITE "NewWebsite"
int main() {
printf("Visit %s\n", SITE);
}
#ifdef to conditionally print debug output#include#define is used to define constants and macrosIn the next chapter, we’ll dive into Inline Functions, Static & Extern Keywords — crucial concepts for memory control and modular programming.