Chapter 0
0.2 program (application or software): a set of instructions;
Machine code (machine language or instruction Set): Limited set of instructions, that a CPU natively understand;
1) instruction is composed of a number of binary digits (bit): MIPS architecture (+ bit long), x86 (variable length);
2) binary digits >>>cpu (instruction set) >>> instruction;
3) example:10110000 01100001;
Assembly Language:each instruction is identified by a short name, variables can identified by names rather than number S
1) translated into machine language by using a assembler and fast;
2) depend on CPU, require a lot of instructions to does simple task, hard to be read;
3) Example:mov al, 061h;
High-level languages:write programs without have to being as concerned about what kind of computer the program is being RU n on;
1) codes>>>compiler>>>executable Program>>>cpu>>program results (C,C++,Pascal, Java
2) codes>>>interpreter>>>cpu>> program results (Perl,javascipt,java)
3) easier to read and write, require less instructions, don ' t concern yourself with details, portable to different archite Cture (except platform-specific functions)
4) example:a = 97;
0.3 C and C + + ' s Philosophy:trust the programmer
0.4 Define The program is solved>>>design a solution>>>write a program that implements the solution >>>compile the Program>>>link object files>>>test and Debug program
Typically, good solutions have the followng characteristics:
1) they is straightforward;
2) They is well documented (especially any assumptions being made);
3) They is built modularly, so parts can is reused or changed later without impacting otherparts of the program;
4) They is robust, and can recover or give useful error messages when something unexpected happens.
Typical editor:lining numbering, syntax highlighting and coloring, an unambiguous font.
A single programs can has tens if not hundreds of individual. cpp files.
The job of compiler is twofold:
1) to check your program and make sure it ollows the rules of the C + + language.
2) to convent each file of the source code into a machine language the file called an object file.
For complex projects, some development environment use a makefile, which are a file that tells the compiler which files to Compile.
Linker:taking all the objects files generated by the compiler and combining them to a single executable program Can run (runtime support), it also includes files from the C + + standard library (all other precompiled libraries).
IDE (integrated development environment) bundles and integrated steps 3,4,5, and 6 together.
0.6 Project:stores The names of all the code files we want to compile, and also saves various IDE settings.
A Console project means that we is going to creat programs the can is run from the DOS or Linx command-line.
A workspace or a solution is a container so can hold one or more realted projects.
0.6A a build configuration (build target) is a collection of project setting so determines how your IDE would build your P Roject. (A Release configuration and a Debug configuration)
The Debug configuration is designed to help you debug your programs, turns off all the optimizations, and includes Debuggi NG information, which makes your programs larger and slower.
The release configuration is designed to being used when releasing your program to the public. This version was typically optimized for size and performance, and doesn ' t contain the extra debugging information.
Notes on learning C + +: Chapter 0