About The Book: - Ivor Horton, Beginning ANSI C++: The Complete Language, 3 Ed. - Ansi C++
About The Book: - Ivor Horton, Beginning ANSI C++: The Complete Language, 3 Ed. - Ansi C++
Programming Languages
• High level languages
– 1950s, FORTRAN, LISP, COBOL
– 1970s, BASIC, C, PASCAL
– 1980s, C++, Object PACAL/Delphi, Objective-C
– 1990s, Java, Python
– 2000s, C#
• Low level language
– Assembly
• C++ language development environments
– Borland C++
– Microsoft Visual C++, Microsoft Turbo C++
Programming Language rating, 2015,
http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html
Refer to Ivor Horton’s Beginning ANSI C++ The Complete Language, 3rd Ed. APress Media, LLC.
Advantages of C++
• High level language with low level programming
(programming down at hardware level)
• Various applications – word processing,
scientific computation, operating system,
computer games
• High efficient procedural programming inherits
from C with powerful object-oriented
programming
• Extensive standard library
• Many commercial libraries supporting a wide
range of operating system environments and
specialized for C++
Refer to Ivor Horton’s Beginning ANSI C++ The Complete Language, 3rd Ed. APress Media, LLC.
C++ names
• Names are referred to as identifiers
– Functions
– Variables
– Types
– Labels
– Namespaces
• Legal names
• Illegal names
Refer to Ivor Horton’s Beginning ANSI C++ The Complete Language, 3rd Ed. APress Media, LLC.
Program Structure
Refer to Ivor Horton’s Beginning ANSI C++ The Complete Language, 3rd Ed. APress Media, LLC.
Compilation process
Refer to Ivor Horton’s Beginning ANSI C++ The Complete Language, 3rd Ed. APress Media, LLC.
Linking process
Refer to Ivor Horton’s Beginning ANSI C++ The Complete Language, 3rd Ed. APress Media, LLC.
Escape sequences
• Control characters
• “Problem” characters
Refer to Ivor Horton’s Beginning ANSI C++ The Complete Language, 3rd Ed. APress Media, LLC.
Simple Programs
• ASCII codes (app. A, p.1009)
– A hexadecimal number: \x or \X
– An octal number: \
• Programs 1.1, 1.2
Refer to Ivor Horton’s Beginning ANSI C++ The Complete Language, 3rd Ed. APress Media, LLC.
White space
• When?
Refer to Ivor Horton’s Beginning ANSI C++ The Complete Language, 3rd Ed. APress Media, LLC.
Procedure and
Object-oriented programming
• Procedure programming
– Also known as routines, subroutines, methods, or
functions, simply contain a series of computational
steps to be carried out
– C, FORTRAN, PASCAL, COBOL, …
• Object-oriented programming(OOP)
– Is a programming paradigm based on the concept
of “object", which are data structures that contain
data, in the form of fields, often known as
attributes; and code, in the form of procedures,
often known as methods.
Refer to Ivor Horton’s Beginning ANSI C++ The Complete Language, 3rd Ed. APress Media, LLC.
Namespace std
#include <iostream>
using namespace std;
int main() // int main(void)
{
cout << “Who is the beginner \?” << endl;
return 0; #include <iostream>
} #include <iostream> void main() // void main(void)
using cout; {
using endl; std::cout << “Who is the beginner \?”
void main() { // void main(void)<< std::endl;
cout << “Who is }the beginner \?”
<< endl;
}