Tag Archives: variable

Subroutines, Functions, Methods

Most, if not all, programming languages allow you to create subroutines, functions, or methods, all of which follow the same principle. You can think of them as black-boxes that contain source code to perform a specific task. For example, you … Continue reading

Posted in Programming Essentials, Uncategorized | Tagged , , , , , , ,

Swapping Variables

Many algorithms, including the world-famous Euclidean, require to swap the values of two variables. So you probably know the following principle. int x = 8; int y = 123; int tmp = x; x = y; y = tmp; However, … Continue reading

Posted in Bit-Twiddling, Information Theory, Uncategorized | Tagged , , , ,

Pointers and References – Part 3 (Kinky Stuff)

Once in a while, I show my students some fancy examples of what you can (but shouldn’t) do with pointers. Most students would be watching the screen with baffled looks on their faces. Those who cannot find any interest in … Continue reading

Posted in Pointers, Uncategorized | Tagged , , ,

Pointers and References – Part 2 (Intermediate Stuff)

This is my second posting on pointers and references. In part 1 you could read about the basic nature of pointers. Now we will have a look on two very common examples of how pointers are being used. 1. Passing … Continue reading

Posted in Pointers, Programming Essentials, Uncategorized | Tagged , , , | Leave a comment

Pointers and References – Part 1 (Rookie Stuff ;)

Pointers are subject of fear for a large number of people. Some of them hate pointers because they can cause nasty problems that are difficult to debug, others hate them because they never really understood what pointers actually are. Indeed, … Continue reading

Posted in Pointers, Programming Essentials, Uncategorized | Tagged , , ,