tailieunhanh - Practical C Programming P2

We will describe how to use two different types of compilers. The first type is the standalone or command-line compiler. This type of compiler is operated in a batch mode from the command line. In other words, you type in a command, and the compiler turns your source code into an executable program. The other type of compiler is contained in an IDE. The IDE contains an editor, compiler, project manager, and debugger in one package. Most UNIX systems use command-line compilers. There are a few IDE compilers available for UNIX, but they are rare. On the other hand, almost. | We will describe how to use two different types of compilers. The first type is the standalone or command-line compiler. This type of compiler is operated in a batch mode from the command line. In other words you type in a command and the compiler turns your source code into an executable program. The other type of compiler is contained in an IDE. The IDE contains an editor compiler project manager and debugger in one package. Most UNIX systems use command-line compilers. There are a few IDE compilers available for UNIX but they are rare. On the other hand almost every compiler for MS-DOS Windows contains an IDE. For the command-line die-hards these compilers do contain a command-line compiler as well. Creating a Program Using a Command-Line Compiler In this section we ll go through the step-by-step process needed to create a program using a command-line compiler. Instructions are provided for a generic UNIX compiler cc the Free Software Foundation s gcc compiler Turbo C Borland C and Microsoft Visual C . 1 1 Turbo C Borland C and Microsoft Visual C are all C compilers that can also compile C code. However if you are using a Borland or Microsoft compiler you might want to skip ahead to the section on using the IDE. Step 1. Create a Place for Your Program You can more easily manage things if you create a separate directory for each program that you re working on. In this case we ll create a directory called hello to hold our hello program. On UNIX type mkdir hello cd hello On MS-DOS type C MKDIR HELLO C CD HELLO 30 TEAM FLY PRESENTS Step 2. Create the Program A program starts out as a text file. Example 2 -1 shows our program in source form. Example 2-1. hello File hello include int main printf Hello World n return 0 Use your favorite text editor to enter the program. Your file should be named . MS-DOS Windows users should not use a word processor such as MS-Word or WordPerfect to write their programs. Word processors .

TỪ KHÓA LIÊN QUAN
crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.