Get the App
SLTechnology News&Howtos  ›  Servers  › 

Linux command

Shulou Source: shulou.com Published: 2022-06-03 10:17:01 12月06日 Update

Pwd View current path

Rm filename delete file

Rm-rf folder Delete folder

The touch command has two functions: one is to update the time tags of existing files to the current time of the system (the default), and their data will remain intact; the other is to create new empty files.

Ls-l view the details of the file, such as size, etc.

Gcc/g++g++ main.cpp-o main precompilation, compilation, assembly, link generation execution file maing++-c main.cpp first compile without link, generate a file main.o (compiled is a single file, regardless of the linked library path, it is useful when there are many project files, to improve efficiency do not have to compile each).

 

Main + main.o-o main link, find the only main () function, and finally generate the execution file maing++-E main.cpp pre-compiled Gmail +-E main.cpp > main.e to output the precompilation to main.e for easy viewing. Precompilation assembles all the header files and macro replacements into one file, because only this one file is compiled at compile time. Main.cpp only compiles without assembly (generating file main.s assembly code). The executable file with debug information is equivalent to the Debug version of win.

Write programs:

Int main (int argc, char * argv [])

Argc is an abbreviation for argument count, indicating the number of parameters passed into the main function.

Argv is the abbreviation of argument vector, which represents the parameter sequence or pointer passed into the main function, and the first parameter argv [0] must be the name of the program and contains the complete path where the program is located, so exactly the number of parameters of the main function that we need to enter should be argc-1.

For example:

# include using namespace std;void main (int argc,char * argv []) {for (int iTuno Tipi)

Tags: File compilation link path function parameter generation dynamic library file program pointer time system number information location folder method time Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology Apple Redmi MySQL Microsoft