Prerequisite knowledge Virtual function memory layout First we have the following simple C++ code class X {<!– –> int x; string str; public: X() {<!– –>} virtual ~X() {<!– –>} virtual void printAll() {<!– –>} }; class Y : public X {<!– –> int y; public: Y() {<!– –>} ~Y() {<!– –>} void printAll() {<!– […]
Tag: variables
2. WebGPU Inter-stage Variables
In the last article, we covered some very basic knowledge about WebGPU. In this article, we’ll review the basics of inter-stage variables. Inter-stage variables come into play between a vertex shader and a fragment shader. Interstage variables work between the vertex shader and the fragment shader. When a vertex shader outputs 3 positions a triangle […]
Shell programming (writing, execution, shell variables, parameter passing, strings, operator usage)
Come and get to know Shell is a program written in C language, through which users can access operating system kernel services. Shell is both a command language and a programming language. Shell script is a script program written for the shell. Shell programming generally refers to shell scripting, not to developing the shell itself. […]
Access and modify local variables using Python strings
When defining a function in Python, the variable space is divided into global variables (global) and local variables (local). If it is defined in a member function of a class, then there is an additional member variable (self) space . So, if in actual operation, if you want to separate these different variable spaces, is […]
Can be seen from a distance but not played with: free variables in Python
Article directory refer to describe Three attitudes of variables global variable free variable cover phenomenon local variable UnboundLocalError UnboundLocalError exception error func1() func2() Bytecode and dis.dis() bytecode dis. dis() Try to disassemble func1() Try to disassemble func2() The reason why UnboundLocalError is thrown global and nonlocal keywords global keyword nonlocal keyword Is it not allowed […]
[System transplantation] uboot loads the root file system through NFS (2) – modify the environment variables bootcmd, bootargs
The network environment has been configured in the previous part. We need to modify the environment variables to ensure that the development board can start normally. The more important environment variables in the uboot environment variables are bootcmd and bootargs Directory 1. Modify the self-starting command – bootcmd 2. Modify the self-starting parameters – bootargs […]
Linux [Script 04] 4 ways of shell script passing parameters (positional parameters, special variables, environment variables and named parameters) example description
Four ways to pass parameters in script 1. Shell basic knowledge 1.1 Interpreter 1.2 Variables 1.3 parameters 1.4 Conditional Statements 1.5 Loop Statements 1.6 Functions 1.7 Input and output 1.8 Command Execution 1.9 Operators 2. Parameter passing 2.1 Positional parameters 2.2 Special variables 2.3 Environment variables 2.4 Named parameters 2.4.1 getopts 2.4.2 getopt 3. Summary […]
The scope, life cycle and memory allocation of variables in C language
Directory 1. Scope 2. Life cycle 3. The relationship between scope and life cycle 4. Memory allocation 1. Scope Scope is the range in which variables can be accessed. The scope of variables can be divided into the following four types: 1. Process scope (global): Can be accessed anywhere in the current process; 2. Function […]
SylixOS environment variables
Environment variables (environment variables) is a list of key-value pairs (“key = value”), each key-value pair is an environment variable, divided into environment variable name and environment variable value, the essence of both are all strings. Environment variables are used to provide a set of dynamic variable parameters for the system. The system provides unified […]
MySQL—stored procedure (local variables, user variables, system variables (global variables, session variables), parameter passing (in, out, inout))
1. Stored procedure features Stored procedures are code encapsulation and reuse at the SQL language level of the database. There are input and output parameters, variables can be declared, and control statements such as if/else, case, while, etc., can be realized by writing stored procedures complex logic functions; Universal features of functions: modularization, encapsulation, code […]