0% found this document useful (0 votes)
49 views14 pages

C++ Lect 2

The document provides a history of C and C++. It discusses that C evolved from BCPL and B programming languages and was developed at Bell Labs. C++ was created in the early 1980s by Bjarne Stroustrup at Bell Labs as an extension of C to support object-oriented programming. C++ is a hybrid language that incorporates both C-like and object-oriented styles.

Uploaded by

Ashar Azeem
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views14 pages

C++ Lect 2

The document provides a history of C and C++. It discusses that C evolved from BCPL and B programming languages and was developed at Bell Labs. C++ was created in the early 1980s by Bjarne Stroustrup at Bell Labs as an extension of C to support object-oriented programming. C++ is a hybrid language that incorporates both C-like and object-oriented styles.

Uploaded by

Ashar Azeem
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 14

History of C and C++

History of C
Evolved from two other programming languages
 BCPL and B
 “Typeless” languages

Dennis Ritchie (Bell Laboratories)


 Added data typing, other features

Development language of UNIX


Hardware independent
 Portable programs
1989: ANSI standard
1990: ANSI and ISO standard published
 ANSI/ISO 9899: 1990

Ms Qurat-ul-Ann
History of C and C++
History of C++
Extension of C
Early 1980s: Bjarne Stroustrup (Bell Laboratories)
“Spruces up” C
Provides capabilities for object-oriented programming
 Objects: reusable software components
 Model items in real world

 Object-oriented programs
 Easy to understand, correct and modify

Hybrid language
 C-like style
 Object-oriented style

 Both

Ms Qurat-ul-Ann
C++ Standard Library
C++ programs
Built from pieces called classes and functions
C++ standard library
Rich collections of existing classes and functions
“Building block approach” to creating programs
“Software reuse”

Ms Qurat-ul-Ann
Java
Java
1991: Sun Microsystems
 Green project
1995: Sun Microsystems
 Formally announced Java at trade show
Web pages with dynamic and interactive content
Develop large-scale enterprise applications
Enhance functionality of web servers
Provide applications for consumer devices
 Cell phones, pagers, personal digital assistants, …

Ms Qurat-ul-Ann
Visual Basic, Visual C++ and C#
BASIC
Beginner’s All-Purpose Symbolic Instruction Code
Mid-1960s: Prof. John Kemeny and Thomas Kurtz (Dartmouth
College)
Visual Basic
1991
 Result of Microsoft Windows graphical user interface (GUI)
 Developed late 1980s, early 1990s

Powerful features
 GUI, event handling, access to Win32 API, object-oriented
programming, error handling
Visual Basic .NET

Ms Qurat-ul-Ann
Visual C++
Microsoft’s implementation of C++
 Includes extensions
 Microsoft Foundation Classes (MFC)
 Common library
 GUI, graphics, networking, multithreading, …

 Shared among Visual Basic, Visual C++, C#

.NET platform
Web-based applications
 Distributed to great variety of devices
 Cell phones, desktop computers

Applications in disparate languages can communicate

Ms Qurat-ul-Ann
Other High-level Languages
FORTRAN
FORmula TRANslator
1954-1957: IBM
Complex mathematical computations
 Scientific and engineering applications
COBOL
COmmon Business Oriented Language
1959: computer manufacturers, government and industrial
computer users
Precise and efficient manipulation of large amounts of data
 Commercial applications

Ms Qurat-ul-Ann
Other High-level Languages
Pascal
Prof. Niklaus Wirth
Academic use

Ms Qurat-ul-Ann
Structured Programming
Structured programming (1960s)
Disciplined approach to writing programs
Clear, easy to test and debug, and easy to modify
Pascal
1971: Niklaus Wirth
Ada
1970s - early 1980s: US Department of Defense (DoD)
Multitasking
 Programmer can specify many activities to run in parallel

Ms Qurat-ul-Ann
The Key Software Trend: Object Technology
Objects
Reusable software components that model real world items
Meaningful software units
 Date objects, time objects, paycheck objects, invoice objects, audio
objects, video objects, file objects, record objects, etc.
 Any noun can be represented as an object

More understandable, better organized and easier to maintain


than procedural programming
Favor modularity
 Software reuse
 Libraries

 MFC (Microsoft Foundation Classes)


 Rogue Wave

Ms Qurat-ul-Ann
Basics of a Typical C++ Environment
C++ systems
Program-development environment
Language
C++ Standard Library

Ms Qurat-ul-Ann
Writing C++ Programs
 The source code of a C++ program is stored on the disk with the file
extension cpp. (.cpp stands for c plus plus).

 The program is stored in a text file on the disk. Any text Editor can be
used to write and edit C++ source code.

 The Borland C++ and Turbo C++ have their own editors for writing the
source code. The source code is written in the editor and then it is
complied.

 The C++ complier translates a C++ source program into machine code.
The machine code is called object code. It is stored in a new file with
extension obj.

Ms Qurat-ul-Ann
Writing C++ Programs cont..
 The object code is then linked to the libraries. After linking the
object code to the libraries, an executable file with the extension .exe
is created.

 The executable program is then run form the operating system


command line.

 For example, a source code of program in C++ is written and stored


in the file first.cpp. After compilation, the object code is saved in the
file first.obj and the executable code is stored in the file first.exe.

Ms Qurat-ul-Ann
Structure of C++ Programs
 C++ consist of three main parts:

 Preprocessor directives

 The main() function

 C++ Statement

Ms Qurat-ul-Ann

You might also like