Introduction to C++ Programming, Lecture notes of Programming for Engineers

The simplest possible c++ program and outlines how it can be made into running code for beginners who want to become professionals. It is a course in the c++ programming language for students who want to become language lawyers and assumes they are bright but not (necessarily) geniuses and willing to work hard. After the course, students will be able to write small colloquial c++ programs and read much larger programs.

Typology: Lecture notes

2018/2019

Uploaded on 02/14/2019

SajidFiras
SajidFiras 🇵🇰

3 documents

1 / 32

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Chapters 1 & 2
Chapters 1 & 2
Programming and Programs
Programming and Programs
Bjarne Stroustrup
Bjarne Stroustrup
www.stroustrup.com/Programming
www.stroustrup.com/Programming
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20

Partial preview of the text

Download Introduction to C++ Programming and more Lecture notes Programming for Engineers in PDF only on Docsity!

Chapters 1 & 2

Chapters 1 & 2

Programming and Programs

Programming and Programs

Bjarne Stroustrup

Bjarne Stroustrup

www.stroustrup.com/Programming

www.stroustrup.com/Programming

Abstract

Abstract

Today, we

Today, we’’ll outline the aims for this course andll outline the aims for this course and

present a rough course plan. We

present a rough course plan. We’’ll introducell introduce

the basic notion of programming and give

the basic notion of programming and give

examples of areas in which software is critical

examples of areas in which software is critical

to our civilization. Finally, we

to our civilization. Finally, we’’ll present thell present the

simplest possible C++ program and outline

simplest possible C++ program and outline

how it can be made into running code.

how it can be made into running code.

This is a course

This is a course

In Programming

In Programming

For beginners

For beginners

who want to become professionals

who want to become professionals

i.e., people who can produce systems that others will use

i.e., people who can produce systems that others will use

who are assumed to be bright

who are assumed to be bright

Though not (necessarily) geniuses

Though not (necessarily) geniuses

who are willing to work hard

who are willing to work hard

Though do need sleep occasionally, and take a normal course load

Though do need sleep occasionally, and take a normal course load

Using the C++ programming language

Using the C++ programming language

Not!

Not!

A Washout course

A Washout course

“If you can get into the science/engineering parts of a university, youIf you can get into the science/engineering parts of a university, you

can handle this course

can handle this course””

A course in

A course in

The C++ programming language

The C++ programming language

For students

For students

who want to become language lawyers

who want to become language lawyers

We try not to get bogged down in technical obscurities

We try not to get bogged down in technical obscurities

who are assumed to be a bit dim and fairly lazy

who are assumed to be a bit dim and fairly lazy

We try not to spoon feed

We try not to spoon feed

Using

Using

Some untested software development methodologies and a lot of

Some untested software development methodologies and a lot of

unnecessarily long words

unnecessarily long words

The Means

The Means

Lectures

Lectures

Attend every one

Attend every one

Notes/Chapters

Notes/Chapters

Read a chapter ahead (about one per lecture)

Read a chapter ahead (about one per lecture)

Read the chapter again after each lecture

Read the chapter again after each lecture

Feedback is welcome (typos, suggestions, etc.)

Feedback is welcome (typos, suggestions, etc.)

The Means (Cont.)

The Means (Cont.)

Work

Work

Review questions in chapters

Review questions in chapters

Review

Review ““TermsTerms”” in Chaptersin Chapters

Drills

Drills

Always do the drills

Always do the drills

Always do the drills before the exercises

Always do the drills before the exercises

Exercises

Exercises

Course specific

Course specific

Projects

Projects

That

That’’s where the most fun and the best learning takes places where the most fun and the best learning takes place

Quizzes

Quizzes

Exams

Exams

Why C++?

Why C++?

You can’t learn to program without a programming language

You can’t learn to program without a programming language

The purpose of a programming language is to allow you to

The purpose of a programming language is to allow you to

express your ideas in code

express your ideas in code

C++ is the language that most directly allows you to express

C++ is the language that most directly allows you to express

ideas from the largest number of application areas

ideas from the largest number of application areas

C++ is the most widely used language in engineering areas

C++ is the most widely used language in engineering areas

http://www.stroustrup.com/applications.html

http://www.stroustrup.com/applications.html

Why C++?

Why C++?

C++ is precisely and comprehensively defined by

C++ is precisely and comprehensively defined by

an ISO standard

an ISO standard

And that standard is almost universally accepted

And that standard is almost universally accepted

The most recent standard in ISO C++ 2014

The most recent standard in ISO C++ 2014

C++ is available on almost all kinds of computers

C++ is available on almost all kinds of computers

Programming concepts that you learn using C++

Programming concepts that you learn using C++

can be used fairly directly in other languages

can be used fairly directly in other languages

Including C, Java, C#, and (less directly) Fortran

Including C, Java, C#, and (less directly) Fortran

Rough course outline (Cont.)

Rough course outline (Cont.)

Throughout

Throughout

Program design and development techniques

Program design and development techniques

C++ language features

C++ language features

Background and related fields, topics, and languages

Background and related fields, topics, and languages

Note: Appendices

Note: Appendices

C++ language summary

C++ language summary

C++ standard library summary

C++ standard library summary

Index (extensive)

Index (extensive)

Glossary (short)

Glossary (short)

Promises

Promises

Detail

Detail : We will try to explain every construct used in this

: We will try to explain every construct used in this

course in sufficient detail for real understanding

course in sufficient detail for real understanding

There is no “There is no“magicmagic””

Utility

Utility : We will try to explain only useful concepts, constructs,

: We will try to explain only useful concepts, constructs,

and techniques

and techniques

We will not try to explain every obscure detailWe will not try to explain every obscure detail

Completeness

Completeness : The concepts, constructs, and techniques can

: The concepts, constructs, and techniques can

be used in combination to construct useful programs

be used in combination to construct useful programs

There are, of course, many useful concepts, constructs, and techniques

There are, of course, many useful concepts, constructs, and techniques

beyond what is taught here

beyond what is taught here

Feedback request

Feedback request

Please mail questions and constructive comments to

Please mail questions and constructive comments to

[email protected]

[email protected]

Your feedback will be most appreciated

Your feedback will be most appreciated

On style, contents, detail, examples, clarity, conceptual problems,

On style, contents, detail, examples, clarity, conceptual problems,

exercises, missing information, depth, etc.

exercises, missing information, depth, etc.

Book support website (www.stroustrup.com/Programming)

Book support website (www.stroustrup.com/Programming)

Local course support website

Local course support website

Why programming?

Why programming?

Our civilization runs on software

Our civilization runs on software

Most engineering activities involve software

Most engineering activities involve software

Note: most programs do not run on things that look

Note: most programs do not run on things that look

like a PC

like a PC

a screen, a keyboard, a box under the table

a screen, a keyboard, a box under the table

Aircraft

Aircraft

Communication

Communication

Control

Control

Display

Display

Signal processing

Signal processing

“GadgetGadget”” controlcontrol

Monitoring

Monitoring

Phones

Phones

Voice quality

Voice quality

User interfaces

User interfaces

Billing

Billing

Mobility

Mobility

Switching

Switching

Reliability

Reliability

Provisioning

Provisioning

Images

Images