Getting Started with Linux under C programming

Source: Internet
Author: User

1. First, take Ubuntu 64-bit operating system as an example

The sudo su in the figure shows the quick access to the root administrator. Here the password default is installed after the Ubunto operating system custom username password, here with the user toto, password: 123456 for example

2. Create the following three files under the/demo directory (see):

Note: The contents of ADD.C are as follows (edit add.c through the VI editor):

One of the add.h (used to declare a function written in a ADD.C file in a sibling directory). As follows:

3. The reference to the custom Add.h function is written in MAIN.C as follows:

4, compile add.c and main.c and merge the two compiled files into the app, the code is as follows:

Where-o above is the command that outputs to the specified directory

5, execute the app. Enter the./app results as follows:

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.