What is the difference between const pointer and pointer to const in C ?

In C programming, pointers are fundamental tools that allow direct manipulation of memory. However, when combined with the const qualifier, they can introduce subtle distinctions that often confuse both beginners and seasoned developers. At first glance, the terms const pointer and pointer to const might seem interchangeable, but they serve different purposes. This article explores […]

Optimizing Enum Storage in C with -fshor-enum flag

When working with C, efficiency in memory usage can be a critical factor, especially in embedded systems or low-level programming. One lesser-known yet powerful GCC compiler flag that can help optimize storage is -fshort-enums. This flag changes the way the compiler allocates memory for enumerations (enum), potentially reducing the size of compiled code. In this […]

Naming convention in C

In the world of C programming, the clarity and maintainability of your code often hinge on a seemingly simple yet crucial aspect: naming conventions. From variables to functions, constants to macros, the names you choose can significantly impact how easily others (and your future self) understand and work with your code. While the C language […]

Function Prototype in C

This article delves into the concept of function prototypes in C, exploring their syntax, purpose, and benefits. Whether you’re a beginner learning the fundamentals or an experienced programmer looking to refine your understanding, mastering function prototypes is a foundational step toward writing efficient and maintainable C programs. In the C programming language, a function prototype […]

Useful shell commands for Python

Hello everyone. This article is for beginners or casual Python users who do not need to know or remember the most commonly used commands related to the Python language. Here is a collection of useful shell commands for working with Python. These commands can help you manage virtual environments, install packages, debug code, and manipulate […]

Include guards in C

Include guards are a mechanism used in C and C++ programming to prevent multiple inclusions of the same header file. They help avoid issues such as redefinition errors, which can occur when the same header file is included multiple times in a program.

How to install stm32 programmer cli on Ubuntu

Hi, today’s post will be short and concrete. As you have probably noticed, installing on Ubuntu anything that’s is not present on apt repository is not as simple as running one shell comand or an exe file like on Windows machines. Fortunately, it’s not very complicated, so don’t worry. Once you know where to find […]

Terminal not launching in Ubuntu 22.04

Hi, today’s post will be very short. Recently I found out that there is a strange bug related to Python version upgrade. My terminal stopped working after I upgraded Python version from 3.10 to 3.11 on Ubuntu 22.04. Not only terminal, but also other preinstalled applications like „Software Updater”. I decided to write a short article about this, first to warn you and second to give you a quick fix.

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.