Accelerated C++ Notes (1-5)

Accelerated C++ const Modifies built-in type variables, custom objects, member functions, return values, and function parameters to ensure that a certain value remains unchanged. <span>const</span> modifies a variable, acting as a constant that can be assigned to a new variable, but the constant itself cannot change. const int a=7; int b = a; // valid … Read more

How Does the C Language Standard Describe and Require ‘const’?

The following content is from deepseek. In the C standard, ‘const’ is primarily a compile-time constraint and commitment that informs the compiler of the programmer’s intention not to modify this object. It does not directly specify the storage location of the object or its immutability at runtime. 1. Core Description of the C Standard (C11 … Read more

Detailed Explanation of C++ Preprocessor and Symbol Constants

Preprocessor and #define Directive Basic Concepts Preprocessor: A program that processes source code before compilation #define: A preprocessor directive used to create symbol constants or macros How it Works: Similar to a global search and replace, but only processes independent tokens Code Example #include <iostream> #include <climits> // Includes definitions for symbol constants like INT_MAX … Read more

Strong Progress in the Semiconductor Industrial Park of Huarong District Aiming for Completion by Year-End

Strong Progress in the Semiconductor Industrial Park of Huarong District Aiming for Completion by Year-End

1 September 25 Thursday Today’s Weather: Light Rain Turning Overcast 22℃-24℃Tomorrow’s Weather: Overcast 23℃-28℃ Estimated reading time: 3 minutes Followed Follow Replay Share Like <!– Just Browsing –> CloseWatch MoreMoreExit Full ScreenSwitch to Vertical Full ScreenExit Full ScreenHuarong Government WebsiteFollowedShare VideoDuration06:20 0/0 00:00/06:20 Switch to Landscape Mode Continue PlayingProgress Bar, 0 percentPlay00:00/06:2006:20Full Screen Playing at … Read more

Daily C Language Knowledge Point: The const Type Qualifier

Daily C Language Knowledge Point: The const Type Qualifier

A. Using const when declaring variables const int nochange; /* This restricts the value of the variable nochange from being modified */ const int nochange = 10; /* This statement is correct */ const int nochange; nochange = 10; /* The compiler will report an error because it cannot be assigned a value after declaration … Read more

Essential Interview Questions for Embedded C Development: What is the Difference Between Const and Volatile?

Essential Interview Questions for Embedded C Development: What is the Difference Between Const and Volatile?

In this article, we will explore the qualifiers in C programming (const and volatile). This is a very important topic in C and embedded systems. In interviews, this is often the first question about the C language. What is the volatile keyword? Why use volatile? What is the difference between const and volatile? What are … Read more

CS106L Lecture 3: C++11 List Initialization and Lvalues vs Rvalues

CS106L Lecture 3: C++11 List Initialization and Lvalues vs Rvalues

Hello everyone, today we will look at Lecture 3 of CS106L Spring 2025, which mainly introduces initialization, references, lvalues and rvalues, as well as the const qualifier. Starting with a Bug Today I took on a development requirement to set the directory path in a static member function of a class in a configurable way. … Read more

11 Key C++ Concepts Explained

11 Key C++ Concepts Explained

Overview This article will answer the following related questions, covering basic C++ concepts: 1. What is the purpose of the const keyword? 2. What is the purpose of the static keyword? 3. What is the difference between new and malloc? 4. What is the purpose of volatile? 5. How is C++ memory partitioned? 6. What … Read more

C++ Programming Tips

C++ Programming Tips

const specifies the semantic constraint of “not modifiable”. It can modify various variables to be constants; when modifying a pointer, appearing on the left side of * indicates that the pointed object is constant, while appearing on the right side indicates that the pointer itself is constant. However, const is more commonly used in function … Read more

Why C++ Experts Secretly Avoid Using const Members: The Reasons Are Beyond Your Imagination!

Why C++ Experts Secretly Avoid Using const Members: The Reasons Are Beyond Your Imagination!

Click the “C++ Players, please get ready” below, select “Follow/Pin/Star the public account” for valuable content and benefits, delivered to you first! Recently, some friends mentioned they did not receive the daily article push, which is due to WeChat changing its push mechanism, causing those who did not star the public account to miss the … Read more