Hello World Console Version (console application)

Source: Internet
Author: User

Original: Hello World Console Version (console application)

Let's introduce the next Hello, world

The "Hello,World" program refers to the output of "Hello, world!" only on the computer screen. (meaning "the World, Hello!") ") This line of string of computer programs. Generally speaking, this is the most basic and simplest program in every computer programming language, and is usually the first program written by a beginner. It can also be used to determine the language's compiler, program development environment, and whether the running environment is installed properly.

The output string "Hello world" as the first demonstration program, has now become the tradition of programming language learning. The program is designed with the computer programming language (CRitchie programming ) for Blaine Collingham (Brian Kernighan) and Dennis Ritchie (Dennis M. Language). is widely circulated; but this book is not the origin of "Hello world", although it is a widespread mistaken perception.

The "Hello World" sample program first appeared in 1972 in the internal technical document "Introduction to the Language B" written by Bell Labs member Blaine Collingham. The programming in C:a Tutorial, which was written by the author in 1974, is also used in this example, and the C programming program, rewritten in this document, retains the model.

At first, the standard print content of the "Hello, World" program must meet the "all lowercase, no exclamation point, a comma after a space." However, it is rare to abide by the tradition.

Create the simplest console application Step1,

Open Delphi7, click menu "File | New | Other ...", select"Console application". Such as:

STEP2,

A project1.dpr file is created by default, such as:

STEP3,

The code in the red box is the whole code of the program, which is explained as follows:

program Project1;     {Start with program key} {$APPTYPE CONSOLE}    {Indicates that the program is a                  list of cell references used by the console program}uses}  sysutils;begin                 {begin. End for program code}  {Todo-ouser-cconsole main:insert codes here}end.                  {End. Program ends}
STEP4,

Here we are at the begin. End adds the code for the display Hello, world function, as follows:

Begin                 {begin. End for program code}  writeln (' Hello, World ');  Readln;end.                  {End. Program ends}
Step5

, press F9 to run the results as follows:

At this point, a simple console program is completed.

Experiment

The above program generates an executable file Project1.exe size of 42KB, if the code in which the uses segment is removed (because Writeln and readln do not use the unit), the size of the build Project1.exe is compiled again to 16KB. It seems that the inclusion and excluding the Sysutils unit varies greatly.

Hello World Console Version (console application)

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.