21天学会c

上传人:壹****1 文档编号:552592323 上传时间:2023-03-08 格式:DOCX 页数:117 大小:248.87KB
返回 下载 相关 举报
21天学会c_第1页
第1页 / 共117页
21天学会c_第2页
第2页 / 共117页
21天学会c_第3页
第3页 / 共117页
21天学会c_第4页
第4页 / 共117页
21天学会c_第5页
第5页 / 共117页
点击查看更多>>
资源描述

《21天学会c》由会员分享,可在线阅读,更多相关《21天学会c(117页珍藏版)》请在金锄头文库上搜索。

1、1st Day Day 1 Getting Si urt(?(i Introduction A Brief History of C+ Programs Solving Problems Procedural, Structured, and Object-OrientedProgramming C+ and Object-Oriented Programming How C+ Evolvedo The ANSI Standard Should I Learn C First? Preparing to Program Your Development Environmento Compili

2、ng the Source Code Creating an Executable File with the Linker The Development Cycle Figure 1.1.o HELLO. CPPYour First C+ Program Listing 1.1. HELLO. CPP, the Hello World program.o Compile Errors Listing 1.2. Demonstration ofo compiler error. Summary Q&A Workshop Quiz ExercisesDay 1Getting StartedIn

3、troductionWelcome to Teach Yourself C+ in 21 Days! Today you will get started on your way to becoming a proficient C+ programmer. You11 learn Why C+ is the emerging standard in software development. The steps to develop a C+ program. How to enter, compile, and link your first working C+ program.A Br

4、ief History of C+Computer languages have undergone dramatic evolution since the first electronic computers were built to assist in telemetry calculations during World War II. Early on, programmers worked with the most primitive computer instructions: machine language. These instructions were represe

5、nted by long strings of ones and zeroes. Soon, assemblers were invented to map machine instructions to human-readable and -manageable mnemonics, such as ADD and MOV.In time, higher-level languages evolved, such as BASIC and COBOL. These languages let people work with something approximating words an

6、d sentences, such as Let I =100. These instructions were translated back into machine language by interpreters and compilers. An interpreter translates a program as it reads it, turning the program instructions, or code, directly into actions. A compiler translates the code into an intermediary form

7、. This step is called compiling, and produces an object file. The compiler then invokes a linker, which turns the object file into an executable program.Because interpreters read the code as it is written and execute the code on the spot, interpreters are easy for the programmer to work with. Compil

8、ers, however, introduce the extra steps of compiling and linking the code, which is inconvenient. Compilers produce a program that is very fast each time it is run. However, the time-consuming task of translating the source code into machine language has already been accomplished.Another advantage o

9、f many compiled languages like C+ is that you can distribute the executable program to people who dont have the compiler. With an interpretive language, you must have the language to run the program.For many years, the principle goal of computer programmers was to write short pieces of code that wou

10、ld execute quickly. The program needed to be small, because memory was expensive, and it needed to be fast, because processing power was also expensive. As computers have become smaller, cheaper, and faster, and as the cost of memory has fallen, these priorities have changed. Today the cost of a pro

11、grammer,s time far outweighs the cost of most of the computers in use by businesses. Well-written,easy-to-maintain code is at a premium. Easy- to-maintain means that as business requirements change, the program can be extended and enhanced without great expense.ProgramsThe word program is used in tw

12、o ways: to describe individual instructions, or source code, created by the programmer, and to describe an entire piece of executable software. This distinction can cause enormous confusion, so we will try to distinguish between the source code on one hand, and the executable on the other.New Term:

13、A program can be defined as either a set of written instructions created by a programmer or an executable piece of software.Source code can be turned into an executable program in two ways: Interpreters translate the source code into computer instructions, and the computer acts on those instructions

14、 immediately. Alternatively, compilers translate source code into a program, which you can run at a later time. While interpreters are easier to work with, most serious programming is done with compilers because compiled code runs much faster. C+ is a compiled language.Solving ProblemsThe problems p

15、rogrammers are asked to solve have been changing. rFwenty years ago, programs were created to manage large amounts of raw data. The people writing the code and the people using the program were all computer professionals. Today, computers are in use by far more people, and most know very little abou

16、t how computers and programs work. Computers are tools used by people who are more interested in solving their business problems than struggling with the computer.Ironically, in order to become easier to use for this new audience, programs have become far more sophisticated. Gone are the days when users typed in cryptic commands at esoteric prompts, only to see

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 商业/管理/HR > 商业计划书

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号