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.

What is referencing and dereferencing in C

This article is intended for the novice programmer who wants to understand the concept of referencing and dereferencing data in the C programming language. I will try to explain it as simply as possible, using some simple and easy to understand examples. To fully understand the topic, it is worth looking at some introduction to […]

CoAP protocol

This article provides a general introduction to the Constrained Application Protocol (CoAP) for those interested in a lightweight, easy-to-implement data transfer solution for devices with limited hardware resources, also known as ‘constrained devices’. CoAP is a UDP-based protocol defined by the RFC 7252 specification. CoAP is very similar to HTTP, has a similar client-server model, […]

User Datagram Protocol basics

User Datagram Protocol is an Internet protocol used to transfer user data between two points without requiring a connection. This makes it very lightweight. It works on the transport layer like TCP, but is much simpler. Unlike TCP, there is no guarantee that the data packet has reached the recipient because no acknowledgements are used. […]

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