Byte-Sized-Chunks: Operator Overloading in C++

Assignment, Pre- and Post-Increment, And Streaming Operators Will Make So Much Sense Now!
0.0 (0 ratings) Instead of using a simple lifetime average, Udemy calculates a
course's star rating by considering a number of different factors
such as the number of ratings, the age of ratings, and the
likelihood of fraudulent ratings.
2 students enrolled
$19
$20
5% off
Take This Course
  • Lectures 9
  • Length 2 hours
  • Skill Level Intermediate Level
  • Languages English
  • Includes Lifetime access
    30 day money back guarantee!
    Available on iOS and Android
    Certificate of Completion
Wishlisted Wishlist

How taking a course works

Discover

Find online courses made by experts from around the world.

Learn

Take your courses with you and learn anywhere, anytime.

Master

Learn and practice real-world skills and achieve your goals.

About This Course

Published 3/2016 English

Course Description

Note: This course is a subset of our much longer course 'Learn By Example: C++ With 75 Solved Examples' so please don't sign up for both:-)

Like a gruff uncle, C++ seems intimidating, when its just being helpful. These examples will help you understand that.

Let's parse that.

  • C++ seems intimidating because all too often, what you see is not what you get.
  • Usually, that's because C++ is trying to help you, but you don't realise that. C++ is incredibly deep, and it sometimes struggles to get you - the programmer - to understand what it's saying
  • These examples will help. Each is self-contained, has its source code attached, and gets across a specific C++ use-case. Each example is simple, but not simplistic.

Operator overloading is a particularly complicated topic - C++ is virtually alone in the ubiquity of overloaded operators. Make sure this doesn't trip you up.

  • What is operator overloading? Understand internal operators, defined as member functions of a class vs external operators defined as global functions. External operators are commonly friend functions of the class on which they operate.
  • Internal or External? When would you choose to have an internal operator implementation vs an external operator implementation? Sometimes you don't have a choice!
  • The += operator
  • The assignment operator
  • Pre- and Post-Increment
  • Streams and the >> and << operators

What are the requirements?

  • Students should have an understanding of programming - concepts such as variables, loops and if-else statements will not be explained
  • Students should have some basic working knowledge of C++, Java or C#

What am I going to get from this course?

  • Get exactly right the semantics of operator overloading for all important operators
  • Understand the precise issues involved in assignment operators, pre- and post-increment and other arithmetic operators
  • Use friend operators, such as the >> and << operators

What is the target audience?

  • Nope! Please don't enroll for this class if you have already enrolled for our 15-hour course 'Learn By Example: C++ Through 75 Solved Examples'
  • Yep! Java and C# programmers - who understand Object Oriented Programming, but are new to C++
  • Yep! Folks with prior programming experience in C. Some prior object oriented programming experience is recommended
  • Yep! C++ programmers looking to get the little details of operator overloading exactly right

What you get with this course?

Not for you? No problem.
30 day money back guarantee.

Forever yours.
Lifetime access.

Learn on the go.
Desktop, iOS and Android.

Get rewarded.
Certificate of completion.

Curriculum

Section 1: Overloaded But Still Productive!
You, This Course, and Us!
Preview
01:27
15:55
What is operator overloading? Understand internal operators, defined as member functions of a class vs external operators defined as global functions. External operators are commonly friend functions of the class on which they operate.
09:21
When would you choose to have an internal operator implementation vs an external operator implementation? Sometimes you don't have a choice!
14:41
All the nitty gritty details to get the += correct. With operator overloading the function signatures are the most complicated, pay close attention to those. Why does this operator return a reference?
12:59
All the nitty gritty details to get the + operator correct. With operator overloading the function signatures are the most complicated, pay close attention to those. Why does this operator return a const object?
15:10
The "++" operator can mean the pre-increment or the post-increment operator. How does C++ disambiguate?
19:48
This is the operator that's implemented the most often! It's also tricky and has many details which have to be exactly right.
07:31
A flashback to how streams and buffers work in C and C++.
15:28

The bitwise shift operators work with input and output streams when overloaded. Learn how to make your custom classes work with IO steams using operator overloading.

Students Who Viewed This Course Also Viewed

  • Loading
  • Loading
  • Loading

Instructor Biography

Loony Corn, A 4-person team;ex-Google; Stanford, IIM Ahmedabad, IIT

Loonycorn is us, Janani Ravi, Vitthal Srinivasan, Swetha Kolalapudi and Navdeep Singh. Between the four of us, we have studied at Stanford, IIM Ahmedabad, the IITs and have spent years (decades, actually) working in tech, in the Bay Area, New York, Singapore and Bangalore.

Janani: 7 years at Google (New York, Singapore); Studied at Stanford; also worked at Flipkart and Microsoft

Vitthal: Also Google (Singapore) and studied at Stanford; Flipkart, Credit Suisse and INSEAD too

Swetha: Early Flipkart employee, IIM Ahmedabad and IIT Madras alum

Navdeep: longtime Flipkart employee too, and IIT Guwahati alum

We think we might have hit upon a neat way of teaching complicated tech courses in a funny, practical, engaging way, which is why we are so excited to be here on Udemy!

We hope you will try our offerings, and think you'll like them :-)

Ready to start learning?
Take This Course