A Few Things About Structs

On Structs A struct is a quintessential example of an abstraction born out of engineering necessity — it was the demand that chose the struct, not the struct that created the demand. 1. What Is a Struct? Wikipedia’s struct article describes it as follows: In C, a struct (structure) is a data structure that falls under the category of composite (aggregate) data types. In plain language, a struct is a composite data type created by combining basic data types as needed. ...

2022-02-25 · 5 mins · 3rd

What Is a Function Pointer?

What Is a Function Pointer? Pointers are one of the most important concepts in C/C++, and also one of the hardest to grasp. Their purpose can be roughly explained with this analogy: just as we can find a friend’s new address after they move by looking up their street number, we can use a pointer to locate and access data at a specific address in memory. We won’t dive deeper into pointers here, though — we’ll focus specifically on function pointers. ...

2022-02-23 · 3 mins · 3rd

The yield Keyword in Python

The yield Keyword in Python This article avoids heavy jargon and introduces the topic in plain language. If you have any hardware development experience, you may already find the yield keyword familiar — it behaves much like an interrupt on a microcontroller. 1. What is yield? As a software developer you are probably well acquainted with return: it terminates a function and passes back a value. yield does something similar — it suspends a function and passes back a value. Note the word suspends; that is the key difference. You can resume execution right where it left off (i.e. at the yield statement) by calling the next method. Sound a lot like a hardware interrupt? ...

2022-02-18 · 2 mins · 3rd