Install VIM, simple Linux instructions

Source: Internet
Author: User
Tags function definition

---restore content starts---

Under Root

sudo apt-get update//Updates

sudo apt-get install vim//installation vim

CD ~ Go to home directory

mkdir Creating a Folder

Touch A.C Create a file A.C

A before inserting the Shift+a line before the cursor

I after inserting the shift+i line after the cursor

O Line break

X Delete a character

Do not use void Main () in Linux

: SP [file name] New file

: Set Nu Open line number

Cursor positioning the number of rows that need to be copied +dd the number of lines of text is copied to the Clipboard

ctrl+w+↑↓ button to switch paging

: WQA All files Save and exit

GCC [max.c hello.c]-o main.out//Put max.c hello.c together to compile the executable file named Main.out

Gcc-c max.c-o MAX.O//Compile the file containing the max () function

A large amount of compilation can be saved in the process of separating the header file from the function definition

First, the functions and the main function are divided into different files, the functions are compiled into an. o file, which can be compiled with different main functions without having to include the header file at the head of the main function.

Compile the common framework and classes used into a static library, which is a collection of. o files. You can save a lot of time when you compile.

* So if someone else's static library is. o file I can't read it when I enter a file with VI How do I know how he uses it?
is to do another [function name].h file, just declare this functional head.

For example, the Max function. h file is

int max (int a,int b);

Save it.

So the Max function has these types of files

Max.c

Max.o

Max.h

Of course. h files can be passed in the main function again

Load this file #include "max.h"

Future users if you want to use the Max function just look at max.h to read

Note that when compiling the. O. c file or compile it together

---restore content ends---

Install VIM, simple Linux instructions

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.