C++ for C programmers   lesson 1 (classes, constructors, methods, templates, is it efficient?) @Bisqwit
C++ for C programmers   lesson 1 (classes, constructors, methods, templates, is it efficient?)  @Bisqwit
Uploaded October 2014 | Updated November 2026, 5 days ago
Are you familiar with C, or with languages based on C? This video gives a quick introduction to C++: a very small core set of things that are new in C++ compared to C. [Subtitles/Captions available]

Topics covered, in order:
- Bidirectional linked list in C
- What is a class (it is a struct)
- Methods
- Struct is a type (typedef is not needed)
- Constructing and destructing
- Template classes
- std::list is already in STL (C++ standard library)
- performance impact (none at all)

Twitter: twitter.com/RealBisqwit
Patreon: patreon.com/Bisqwit (alternatives at iki.fi/bisqwit/donate.html)
Twitch: twitch.tv/RealBisqwit
Homepage: iki.fi/bisqwit

Things I forgot to mention:
- methods (member functions) do not increase the size of the struct/class at all. They literally work just the same way as the original C code in this video works, even though they're defined in between the struct's { and }. Memory usage per class instance is not increased (and scalability is not hurt), no matter how many methods the class defines.

Topics intentionally omitted for clarity and brevity, even though they would be good style for this program:
- copy constructor / assign operators
- member initialization in constructor
- public and private
- std::string rather than const char*
- const references rather than T verbatim
- exception safety

It's been a while since I last published videos containing English speech. I think I've taken a step backwards towards robotic speech, due to lack of practice. Sorry about that. English is still not my native language!

Same lesson in HTML format: bisqwit.iki.fi/story/howto/cpp/lesson1
C++ for C programmers   lesson 1 (classes, constructors, methods, templates, is it efficient?)Papers, Please speedrun - ending 19 - 02:47:08 (old WR) Single SegmentBubble Bobble ※ Cracking Videogame Passwords S1e4Live: Creating a Terminal Emulator (PART 6)Ur-Quan Masters: No-Starbase Practice Run: TOTALLY UNCUT PART 6/9Installing Debian Buster (Modern Linux distribution)Bisqwit Plays: The Talos Principle [2/4] (complete blind 100% all endings)How does PCM audio work? :: Case study and example C++ codeLogic 3: Quantifiers (univ. & exist.), Proofs part 1 — Tutorial 3/4Ur-Quan Masters: No-Starbase Practice Run: PART 6/12Undertale: Counting the dogsHow Bisqwit replies to your comments (2015 edition)
Bisqwit |

C++ for C programmers -- lesson 1 (classes, constructors, methods, templates, is it efficient?)

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER