If you have any query feel free to chat us!
Happy Coding! Happy Learning!
Copy code
int x = 10, y = 20;
int* p1 = &x;
int* p2 = &y;
printf("%d %d\n", *p1, *p2);
Copy code
int x = 10;
int* p1 = &x;
int* p2 = p1;
*p2 = 20;
printf("%d\n", x);
Copy code
int x = 10;
int* p1 = &x;
int* p2 = p1;
p1 = NULL;
printf("%d\n", *p2);
How can you pass an array of integers to a function and make the function able to modify the elements of the array?
What is the difference between a pointer and an array in C?
How can you check if a pointer is pointing to a valid memory location or not?
How can you pass a pointer to a function and make the function able to modify the pointer itself?
How can you allocate memory dynamically for an array of integers using pointers?
What is a pointer to a pointer in C and when is it useful?
How can you traverse an array using pointers?
Answers:
Comments: 0