Products
Features
YouTube Video Summarizer
Summarize YouTube videos
Web & PDF Highlighter
Highlight web pages & PDFs
Chat with PDF
Ask any PDF questions with AI
Ask AI Clone
Chat with your highlights & memories
Audio Transcriber
Transcribe audio files to text
Glasp Reader
Read and highlight articles
Kindle Highlight Export
Export your Kindle highlights
Idea Hatch
Hatch ideas from your highlights
Integrations
Obsidian Plugin
Notion Integration
Pocket Integration
Instapaper Integration
Medium Integration
Readwise Integration
Snipd Integration
Hypothesis Integration
Apps & Extensions
Chrome Extension
Safari Extension
Edge Add-ons
Firefox Add-ons
iOS App
Android App
Discover
Discover
Ideas
Discover new ideas and insights
Articles
Curated articles and insights
Books
Book recommendations by great minds
Posts
Essays and notes from readers
Quotes
Inspiring quotes collection
Videos
Curated videos and summaries
Explore Glasp
Glasp Newsletter
Weekly insights and updates
Glasp Talk
Interview series with great minds
Glasp Blog
Latest news and articles
Glasp Use Cases
Learn how others use Glasp
Build & Support
Glasp API
Access Glasp's API for developers
MCP Connector
Connect Glasp to Claude & ChatGPT
Community
Glasp Reddit Community
Students
Student discount and benefits
FAQs
Frequently Asked Questions
AboutPricing
DashboardLog inSign up

The "this" keyword in C++

226.8K views
•
September 6, 2017
by
The Cherno
YouTube video player
The "this" keyword in C++

TL;DR

The "this" keyword in C++ is a pointer to the current object instance within a member function of a class.

Transcript

hey what's up guys my name is a Jonah and welcome back to my stables last series got a bit of a different set today hope you guys like it today we're gonna be talking all about what the this keyword is in C++ did this that's kind of hard to say so we have a keyword and C++ called this which is only accessible to us through a member function and the... Read More

Key Insights

  • ❓ The "this" keyword in C++ is a pointer to the current object instance within a member function.
  • 🏛️ It is used to differentiate between class members and function parameters with the same name.
  • 🏛️ The "this" keyword allows for assigning values to class variables, calling functions outside the class, and accessing constant class instances.
  • 💘 Using "this" with the arrow operator (->) simplifies assignment of values to class variables.
  • 🅰️ In a constant member function, the type of "this" will be a constant pointer to the current object instance.
  • 🥺 The "this" keyword should not be used to delete the current object instance, as it can lead to memory access issues.
  • 🫵 Upgrading the audio quality of the video has improved the viewing experience for the audience.

Install to Summarize YouTube Videos and Get Transcripts

Explore YouTube Video Summarizer or Get YouTube Transcript Extractor

Questions & Answers

Q: What is the purpose of the "this" keyword in C++?

The "this" keyword in C++ is used to reference the current object instance within a member function of a class. It allows the programmer to distinguish between class members and function parameters with the same name.

Q: Can the "this" keyword be used outside of a member function?

No, the "this" keyword is only accessible within a member function of a class. It represents a pointer to the current object instance.

Q: How can the "this" keyword be used to assign values to class variables?

By using the "this" keyword followed by the arrow operator (->), values can be assigned to class variables. For example, "this->x = x;" assigns the value of the function parameter "x" to the class variable "x".

Q: Can the "this" keyword be used to call functions outside of the class?

Yes, the "this" keyword can be used to pass the current object instance as a parameter to a function outside of the class. This allows the function to operate on the current object's data.

Key Insights:

  • The "this" keyword in C++ is a pointer to the current object instance within a member function.
  • It is used to differentiate between class members and function parameters with the same name.
  • The "this" keyword allows for assigning values to class variables, calling functions outside the class, and accessing constant class instances.
  • Using "this" with the arrow operator (->) simplifies assignment of values to class variables.
  • In a constant member function, the type of "this" will be a constant pointer to the current object instance.
  • The "this" keyword should not be used to delete the current object instance, as it can lead to memory access issues.
  • Upgrading the audio quality of the video has improved the viewing experience for the audience.
  • Support for the series is available through Patreon, which helps in producing higher-quality and more frequent episodes.

Summary & Key Takeaways

  • The "this" keyword in C++ is a pointer to the current object instance within a member function.

  • It allows the programmer to reference the class members instead of the function parameters with the same name.

  • The "this" keyword is useful for assigning values to class variables, calling functions outside the class, and accessing constant class instances.


Read in Other Languages (beta)

English

Share This Summary 📚

Summarize YouTube Videos and Get Video Transcripts with 1-Click

Download browser extensions on:

Try YouTube Summary with ChatGPT & Claude or YouTube Transcript Generator

Explore More Summaries from The Cherno 📚

What Does the Static Keyword Mean in C++ Classes? thumbnail
What Does the Static Keyword Mean in C++ Classes?
The Cherno
Destructors in C++ thumbnail
Destructors in C++
The Cherno
How the C++ Compiler Works thumbnail
How the C++ Compiler Works
The Cherno
How to DEBUG C++ in VISUAL STUDIO thumbnail
How to DEBUG C++ in VISUAL STUDIO
The Cherno
How to REALLY learn C++ thumbnail
How to REALLY learn C++
The Cherno
Maths | Game Engine series thumbnail
Maths | Game Engine series
The Cherno

Summarize YouTube Videos and Get Video Transcripts with 1-Click

Download browser extensions on:

Try YouTube Summary with ChatGPT & Claude or YouTube Transcript Generator

Apps & Extensions

  • Chrome Extension
  • Safari Extension
  • Edge Add-ons
  • Firefox Add-ons
  • iOS App
  • Android App

Key Features

  • YouTube Video Summarizer
  • Web & PDF Summarizer
  • Web & PDF Highlighter
  • Chat with PDF
  • Ask AI Clone
  • Audio Transcriber
  • Glasp Reader
  • Kindle Highlight Export
  • Idea Hatch

Integrations

  • Obsidian Plugin
  • Notion Integration
  • Pocket Integration
  • Instapaper Integration
  • Medium Integration
  • Readwise Integration
  • Snipd Integration
  • Hypothesis Integration

More Features

  • APIs
  • MCP Connector
  • Blog & Post
  • Embed Links
  • Image Highlight
  • Personality Test
  • Quote Shots

Company

  • About us
  • Blog
  • Community
  • FAQs
  • Job Board
  • Newsletter
  • Pricing
Terms

•

Privacy

•

Guidelines

© 2026 Glasp Inc. All rights reserved.