Single point of exit

Using a single point of exit in C (or other programming languages) is often considered good practice because it improves code readability and maintainability, and reduces the likelihood of bugs. In this article, we’ll take a deep dive into this topic to see if it’s really true.

Why C strlen function is considered as not safe

n the world of programming, writing secure and efficient code is a constant challenge, especially when working with low-level languages like C. C provides developers with powerful tools, but with great power comes great responsibility. Among these tools is the strlen function, a staple of string manipulation in C. While seemingly simple and straightforward, improper use of strlen can lead to unexpected behavior, performance issues, and even critical security vulnerabilities. This article explores the potential pitfalls of using strlen, why it’s considered unsafe in certain situations, and how developers can adopt safer practices to protect their applications.

Stack, heap and memory management in microcontrollers

In this article I’ll do my best to explain as simply as possible how memory management in microcontrollers works, what are „stack” and „heap” areas, and what’s the difference between them. Let’s start with a general diagram presenting how „uC” RAM memory is divided into diffrent arreas: Starting from the bottom, which is the beginning […]

What is function prototype in C

In C language function prototype is just information for the compiler about the existence of a function. It also provides basic information about its name, returning type, and list of accepted arguments. Let’s see it in an example: #include <stdio.h>void print_hello_msg(void); // This is prototype for the print_hello_msg functionint main(){ print_hello_msg(); return 0;}void print_hello_msg(void){ printf(„Hello […]

Declaration vs Definition

In this article, I will explain two most important concepts in C language that are very often confused by beginner embedded developers. I will explain what each of them means and what is the key difference, so from now on you won’t confuse them