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: