Recently I decided to dive into low-level programming, and of course I started with revising pointers. I picked up the free e-book Extreme C by Kamran Amini and found an interesting example in it.
void func(int* a) {
int b = 10;
*a = 5;
a = &b;
}
Above function is:
- Receiving a pointer to variable “a”.
- Initializing a new variable “b”.
- Dereference pointer “a” and changing it’s value to 5.
- Finally replacing the address of “a” with “b”.
Read Complete Article
Top comments (0)