Professional Documents
Culture Documents
Chapter2 1
Chapter2 1
Shaobai Kan
chapter 2
An IDE consists of
- a code editor
- a compiler
- a debugger
- a graphic user interface (GUI) builder
• Computer Lab
—Visual C++ 2005 & Visual C++ 2008
• Home
—Visual C++ 2008 Express Edition
http://www.microsoft.com/express/download/
hello.cpp
Output.
Hello World!
Lines 1 & 2.
" //Shaobai Kan, 9/1/08
//Text-Printing Programming "
Lines 1 & 2.
" //Shaobai Kan, 9/1/08
//Text-Printing Programming "
Comments.
"//................... "
Line 3.
" # include <iostream> "
—— Preprocessor directive.
Line 3.
" # include <iostream> "
—— Preprocessor directive.
hello.cpp hello.cpp
iostream.h
# include <iostream>
Source Code
Source Code
B B
Source Code
A
(a) (b)
Definition
………..
closing brace }
main function.
Line 6.
" std::cout « "Hello World!\n"; "
Line 6.
" std::cout « "Hello World!\n"; "
—— Output statement.
• std — namespace.
std::— use the standard input/output library.
• white space — blank lines, space characters and tab
characters.
Remark.
***********
*********
*******
*****
***
*
*
* *
* * * *
* *
* *
*