C language development under linux

Vim work mode:
command work mode, insert work mode, bottom line work mode
Command mode: h, move the cursor to the left, l, right, j, down, K, up, ^ the beginning of the line, $, the end of the line, 0 , At the
beginning of the line yy copies the line where the cursor is located, nyy copies the line where the cursor is located n lines down, p pastes
x to delete, X deletes the previous one, dd deletes a line, ndd, deletes where and down n lines.
Insertion mode: i inserts a new character, I inserts at the beginning of a line, a starts to insert the next character, A inserts at the end of a line, o inserts at the beginning of the next line, and O inserts at the beginning of a line.
Bottom line working mode: q exit, want to save wq, q! force exit, x save and exit, x! force save and exit, /string, search, press n to find down, and N to find up. ? String, same as /.

sudo /usr/share/vim/vimrc 
"syntax on: open the file to be highlighted, the keywords are colored
"set showmatch: display matching brackets
" set nu: display line numbers
"set autoindent: automatic indentation of new lines
" set cindent: The automatic indentation of C language
"set mouse = a: support mouse operation to
remove" can have the corresponding function.

Compiler:
If gcc can't find the header file
sudo apt-get install build-essential     
or it doesn't work, change the source first, and type this sentence.
gcc -v View the gcc version number.
Gcc support: .cc language.cc .cp .cpp .c++ .cxx .C c++ language.ic preprocessed.s preprocessed assembler.h header file.ocompiled target File
example: gcc tin.c -o tin
can also: gcc -E -o hello.i hello.c preprocess
        gcc -S -o hello.s hello.i to compile and form assembly file
        gcc -c -o hello.o hello.s process the assembly file
        gcc -o hello hello.o to form a link

Project manager: make
Example: hello.o:tin.c
        gcc -c tin.c -o hello.o
liu@DESKTOP-MHNDSB8:~/mon$ make hello.o
gcc -c tin.c -o hello.o
Example: test: ao bo co
    gcc -o test $^
%.o:%.c
    gcc -c -o $@ $<
clean:
    rm *.o test
.PHONY:clean
$< the name of the first dependent file.
$@ The full name of the target file.
$^ So non-repetitive dependent files are separated by spaces.
Pattern rules: similar to ordinary rules, with %标名
# for comments    
 

Guess you like

Origin blog.csdn.net/qq_38531460/article/details/102888362