Follow Nisy to learn C language

Source: Internet
Author: User

The editor is an IDE using the environment Turboc, using Edit in the DOS window as the editor, a bit like vim, using a system on a xp-sp3 virtual machine.

Nisy says there are two languages, a scripting language, and an underlying language, like now my Python and the C I'm learning. The current state is two are not fine.

After the C language learning model and the programming working mode as well as the importance of memory and 1+1=, we started to use the edit editor to learn grammar and implement the first program.

1. Edit the test file test.c

Figure 1 DOS Window command line

The first line of CD turboc2 into the TURBOC2 C program development environment, the second line of edit test.c Call the edit editor to create a test.c file, enter:

Figure 2 Editor in WinXP

Once you are familiar with the basic functions of this editor, start programming. C has a framework, the main () function plus a {} framework, inside the frame is a syntax such as a ";", you can save and exit the editing window to complete the first Test program. The program is actually a. c file, theTCC test.c after the. C code file is the source program compiled into a test.exe executable, command test.exe is to run the Test.exe executable on the Windows platform, because the text file test.c does not publish any instructions in the source program except ";", so nothing happens on the screen, and then it goes back to the last line.

The next step is the working state of the memory, which is the interaction between programming and memory.

2. Apply for Memory

A block called a byte, we apply the bytes generally used:

Char xxxx ( also to address, and to line )//Application of a byte

int XXXX//Request two bytes

1 Main ()2 {3   inti =1; #申请两个字节 and save the data 1 in the Code name #4   intj =1;5   intK =0; #或者int k;k=0#6K = i +J; #k是一个目标地址, the and transmission of I and J to space k#7 8printf"%d", K); The #printf () function is to output the data to the screen, print the integer in the memory, from the code # of K9}

Enter the above code, compile and run the changed file test.c, Output 2

Figure 3 1+1=2

Follow Nisy to learn C language

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.