A new start, learning C language programming in linux

Source: Internet
Author: User
In the new beginning, I learned C language programming in linux-general Linux technology-Linux programming and kernel information. The following is a detailed description. Here we will introduce some basic knowledge of C/C ++ programming on Linux/UNIX machines.

· Background knowledge required

· Basic Development Environment

· Ways to get help

· Learn the basic steps through an instance

Prerequisite prerequisites:

To write C Programs on Linux, you must be familiar with the following basic knowledge:

1. C language programming basics, at least need to know some basic syntax, control flow and other programming knowledge.

Have a common understanding of common standard C function libraries.

2. Familiar with Linux/UNIX operations, Master common shell commands, such as ls, cat, cp, mkdir... Etc.

Environment required by Environment:

1. For Linux/Unix operating systems, you can also use cygwin in windows.

We will discuss all the operations through shell command lines. What should I do if I enter Linux with a graphic interface? As long as you open a terminal command, it is exactly the same as the command line environment (you can find the terminal command when you open the Start Menu ).

2. required development tools:

1) The input program requires an editor. Commonly used methods include vi and emacs. Input vi, emacs,… on the command line ,... You can enter the editing Environment

About vi

About EMACS

2) C language compiler. Commonly used are the gnu c language compiler gcc (compiling C Programs) and g ++ (compiling C ++ programs ).

About gcc/g ++

About makefile >>>> used to simplify the compilation process

Here is an entry-level article about C Programming in Linux.

3) common tool for program debugging: gdb.

About gdb

Get help for help:

Linux documentation is very rich. It's the quickest and most convenient. You can store all the information on your machine. Don't waste it.

On the command line, enter the shell command man or info:

$ Man gcc >>>> this command can obtain the gnu c language compiler documentation. Of course, they are in English.

About man

Info

There are also a lot of resources on the network, so that you do not know what is your most needed. How to obtain valuable information

Take a look at the related resources on loveunix >>>

Basic steps:

1. Input Source Code

2. Compile, link, and run

3. debug the program

Let's start with the basic hello world Program and perform the following operations:

1. Input Source Code
QUOTE:

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.