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.
In this chapter, we explore more powerful applications of pointers: Pointer to Pointer and Function Pointers. These are essential for mastering dynamic memory, arrays of strings, callbacks, and low-level programming.
A pointer to pointer is a variable that stores the address of another pointer. It's especially useful when dealing with 2D arrays, dynamic memory, or passing pointers by reference.
int a = 10;
int *p = &a;
int **pp = &p;
printf("Value of a: %d\n", a);
printf("Value via *p: %d\n", *p);
printf("Value via **pp: %d\n", **pp);
void updatePointer(int **pp) {
static int x = 50;
*pp = &x;
}
int main() {
int *p;
updatePointer(&p);
printf("Updated value: %d\n", *p); // Output: 50
}
Function pointers are used to point to functions. You can invoke a function via a pointer. They are widely used in callbacks, menu-driven programs, and implementing dynamic behavior.
int add(int a, int b) {
return a + b;
}
int main() {
int (*fptr)(int, int);
fptr = add;
printf("Sum = %d\n", fptr(3, 5)); // Output: 8
}
void menu() {
printf("1. Home\n2. Courses\n3. Exit\n");
}
void courses() {
printf("Available courses at UdaanPath...\n");
}
int main() {
void (*actions[2])() = {menu, courses};
actions[0](); // Calls menu
actions[1](); // Calls courses
return 0;
}
In the next chapter, we'll cover Linked Lists — dynamic data structures that are the building blocks of advanced algorithms.