October 2004
Beginner
408 pages
9h 24m
English
Now that you have a basic understanding of addresses (albeit thanks to trivial examples), it's time to look at some tasks that cannot be solved without using addresses. The remaining examples will show how useful pointers are.
In this next example, pointers to variables that exist in the main function will be passed to another function. Why is this useful? Consider this example: you want to create a function that swaps the values of two variables. You might be tempted to try a program like Script 9.5.
The problem is that such an application will not work ...
Read now
Unlock full access