Blog

Page 703 of my articles, tutorials, and thoughts

Latest Articles

Cover Image for How do the likely/unlikely macros in the Linux kernel work and what is their benefit?
branch-predictionc#gcc

How do the likely/unlikely macros in the Linux kernel work and what is their benefit?

Published on September 2, 2023

# How do the `likely`/`unlikely` macros in the Linux kernel work and what is their benefit? If you've been delving into the Linux kernel recently, you may have come across some intriguing calls like these: ```c if (unlikely(fd < 0)) { /* Do something

Cover Image for Why use pointers?
c#

Why use pointers?

Published on September 2, 2023

# Why Use Pointers in Programming? šŸ’” So, you've just started learning C++ and are wondering why on earth you would need to use pointers. Don't worry, it's a common question, and in this blog post, I'll break it down for you in a simple and engaging way!

Cover Image for What is the LD_PRELOAD trick?
c#environment-variables

What is the LD_PRELOAD trick?

Published on September 2, 2023

šŸ“ Blog Post: Demystifying the LD_PRELOAD Trick: Unleashing the Power of Symbols šŸŽ­ Introduction: --------------------- šŸ‘‹ Hey Tech Enthusiasts! Have you ever stumbled upon the mysterious term "LD_PRELOAD trick" while exploring the programming world? 🌐 I

Cover Image for How do I print the full value of a long string in gdb?
c#debuggingstring

How do I print the full value of a long string in gdb?

Published on September 2, 2023

šŸ“šŸ–Øļø **Printing the Full Value of a Long String in GDB** Are you a developer trying to debug your C-string using GDB? šŸ¤” Worried that the string is being abbreviated and you're missing valuable information? šŸ˜• Don't worry! In this blog post, we'll addres

Cover Image for Is Fortran easier to optimize than C for heavy calculations?
c#performance

Is Fortran easier to optimize than C for heavy calculations?

Published on September 2, 2023

# Is Fortran šŸš€ easier to optimize than C ⚔ for heavy calculations? Have you ever wondered if Fortran is truly faster than C when it comes to heavy calculations? šŸ¤” Well, let's dive into this topic and find out if the rumors are true! šŸ’” ## The Great Fo

Cover Image for How can I get a file"s size in C?
c#file

How can I get a file"s size in C?

Published on September 2, 2023

# šŸ“ How to Get a File's Size in C šŸ¤” So, you're coding in C and wondering how to find the size of a file? Don't worry, we've got you covered! Knowing the size of a file is essential, especially if you want to allocate memory dynamically using `malloc()`

Cover Image for Difference between a Structure and a Union
c#

Difference between a Structure and a Union

Published on September 2, 2023

# Understanding the Difference Between a Structure and a Union <blockquote "A structure and a union may seem similar, but they have important differences."\> Have you ever wondered about the difference between a `struct` and a `union`? šŸ¤” Don't worry; yo

Cover Image for How do you format an unsigned long long int using printf?
c#printfsyntax

How do you format an unsigned long long int using printf?

Published on September 2, 2023

šŸ“ How to Format an unsigned long long int Using printf? 🧐 So you have encountered an unexpected result while trying to print an `unsigned long long int` using `printf()`. You're not alone in this struggle! In this blog post, we'll address the common iss

Cover Image for How to allocate aligned memory only using the standard library?
c#memory-management

How to allocate aligned memory only using the standard library?

Published on September 2, 2023

# How to Allocate Aligned Memory Using the Standard Library ✨ Have you ever encountered a situation where you needed to allocate memory and ensure it is aligned to a specific boundary? If so, you're in the right place! In this blog post, we'll explore how

Blog | Matheus Mello