Tag Archives: c

How to use ancient Morse code to solve a modern problem

If you own a Raspberry Pi mini computer the following problem may sound familiar to you: You just connected your Rasperry Pi to a network with automatic DHCP. Now you need to find out what IP address has been assigned … Continue reading

Posted in c, Information Theory, Linux, Raspberry Pi, Uncategorized | Tagged , , , , , , ,

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 , , , ,

Lost in translation (C vs. Assembly Language)

In my classes on microcontroller programming I often draw comparisons between C and assembly language. This is to show my students that either programming language has both advantages and disadvantages. While the efficiency of C code predominantly depends on how … Continue reading

Posted in Programming Essentials, 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 , , ,