Detailed Explanation of C++ Integer Types

Basic Integer Types C++ provides various integer types, arranged in increasing order of width: Type Typical Size Value Range char 1 byte -128 to 127 or 0 to 255 short 2 bytes -32,768 to 32,767 int 4 bytes -2,147,483,648 to 2,147,483,647 long 4 or 8 bytes Depends on the system long long 8 bytes -9,223,372,036,854,775,808 … Read more

Why Do We Sometimes Write LL in C++?

Why do we sometimes write LL in C++? Why do we sometimes write <span>LL</span> in C++? When writing C++, you often see others adding <span>LL</span> after numbers, for example, <span>1000000000000LL</span>. As a beginner, you might wonder: can’t we just write <span>1000000000000</span> directly? The answer is — not necessarily. The story begins with an “overflow” Imagine … Read more

In-Depth Analysis of Floating Point Numbers in C: Understanding Overflow and Underflow

In-Depth Analysis of Floating Point Numbers in C: Understanding Overflow and Underflow

Today, we will discuss a concept that is very important yet often overlooked in the use of floating point numbers (float) in C language—overflow and underflow. Do you remember the integer overflow phenomenon we encountered when discussing integer types? When a value exceeds the range that its type can express, it may “wrap around” to … Read more

Why Redis Doesn’t Use C Language Strings and Instead ‘Reinvented the Wheel’

Why Redis Doesn't Use C Language Strings and Instead 'Reinvented the Wheel'

Follow us, bookmark us, and join us every day at 7:30 for daily Java content sharing. Technical Analysis The ‘Four Sins’ of C Language Native Strings The C language does not have a true “string” type. Its so-called string is simply a character array (<span>char*</span>) terminated by a null character<span>\0</span>. This simple design leads to … Read more

Type Conversion in C: The Traps of ‘Implicit’ and the Art of ‘Explicit’

Type Conversion in C: The Traps of 'Implicit' and the Art of 'Explicit'

Today, we will discuss a very important topic—Type Conversion Many tutorials may delve into this topic when discussing floating-point numbers or object-oriented programming, but I insist on addressing it earlier. Because in C language, if you do not understand the range and calculation principles of various integer types discussed in the previous lessons, you cannot … Read more

5 Essential C Language Memory Detection Tools to Eliminate Segmentation Faults!

5 Essential C Language Memory Detection Tools to Eliminate Segmentation Faults!

Top Five Memory Issues Issue Type Frequency Severity Typical Symptoms Memory Leak 45% ⭐⭐⭐⭐ Memory continuously grows, eventually OOM Dangling Pointer 25% ⭐⭐⭐⭐⭐ Random crashes, segmentation faults Buffer Overflow 15% ⭐⭐⭐⭐⭐ Data corruption, security vulnerabilities Double Free 10% ⭐⭐⭐⭐ Heap corruption, unpredictable crashes Uninitialized 5% ⭐⭐⭐ Random values, logical errors Typical Problem Code: // 💀 … Read more

Comprehensive Analysis of String Handling Functions in C Language

Comprehensive Analysis of String Handling Functions in C Language

Comprehensive Analysis of String Handling Functions in C Language In C language, strings are stored as arrays of characters and are terminated with a null character <span>'\0'</span>. The C standard library provides a series of functions to handle strings, which are defined in the header file <span><string.h></span>. This article will detail commonly used string handling … Read more

Latest Discovery: Vulnerabilities in NFC Readers Challenge Embedded System Security!

Latest Discovery: Vulnerabilities in NFC Readers Challenge Embedded System Security!

According to a report by Wired magazine, IOActive security researcher Josep Rodriquez warns that: many NFC readers used in modern ATMs and POS systems have vulnerabilities that make the machines susceptible to attacks. A video shared by Wired shows that Rodriquez was able to make an ATM in Madrid display error messages simply by waving … Read more

MIPS Stack Overflow: ROP Construction and Shellcode Injection

MIPS Stack Overflow: ROP Construction and Shellcode Injection

0. Introduction Recently, I wrote about the DVRF series topics, and I still feel a bit overwhelmed by the construction of ROP, so I decided to delve deeper into how to construct ROP chains during the May Day holiday. Note: The entire process should be replicated using Ubuntu 16.04. Do not use 18.04 or 20.04, … Read more

C Language Algorithm – Integer Reversal Problem

C Language Algorithm - Integer Reversal Problem

Today’s algorithm problem is to solve the "Integer Reversal" algorithm using C language. Below are my algorithm ideas and implementation. Let’s take a look. Algorithm Problem Given a 32-bit signed integer, reverse it. Algorithm Idea We will use a clever method to solve the integer reversal problem. The idea of the algorithm is to reverse … Read more