# C.1 — The end?

Congratulations! You made it all the way through the tutorials! Take a moment and give yourself a well-deserved (insert something you enjoy here).

Now, after breathing a long sigh of relief, you’re probably asking the question, “What next?”.

What next?

By this point, you should have a solid understanding of the core C++ language. This sets you up well to continue your learning journey into other adjacent areas. So if there’s something you’re really interested in learning about, now’s a good time to see whether you have enough knowledge to jump into that.

However, for most users, I think there are a few natural next steps.

Data structures and algorithms

If you haven’t already learned about these, this is my strongest recommendation.

A data structure is a collection of data and a well defined set of methods to access or manipulate that data. The most common data structure used in programming is the array, which holds a number of elements of the same type in sequential memory. You can manipulate the data inside an array by using array indexing to directly access (or modify) the elements inside the array. In the lessons, we also covered the stack data structure, which provide push, pop, and top functions to access the data on the stack.

An algorithm is a self-contained set of operations that typically manipulate or calculate outputs from the data in a data structure. For example, when you look through an array to find the median value, you’re executing an algorithm. Binary search is an algorithm to determine if a given value exists in a sorted array. Sorting routines (such as selection sort and bubble sort) are algorithms that sort data sets.

Over the years, mathematicians and computer scientists have come up with a fairly standard set of reusable data structures and algorithms that are useful for constructing more complex programs. These all have various tradeoffs. For example, arrays are fast to access data and sort, but slow to add or remove elements. Linked lists, on the other hand, are slow to access data and sort, but very fast to add or remove elements (if you already know where those elements are).

Why does it matter? Let’s use an analogy. If you were going to build a house, you could build all of your tools from scratch if you wanted. But it would take a long time, and you’d probably mess quite a few things up and have to start over (ever created a hammer? Me neither). Also, if you use the wrong tool for the job, your quality would suffer (try nailing in nails with a wrench).

More likely, you’d go to the local hardware store and buy a few tools: a hammer, a level, a carpenter’s square, etc… and then read some internet tutorials on how to use them properly. These would vastly accelerate your house construction efforts.

Data structures and algorithms serve the same purpose in programming: they are tools that, if you know how to use them, can vastly accelerate how quickly you can get things done at quality.

The good news is that many of these data structures and algorithms have already been implemented in the standard library. You’ve already encountered some of these in the preceding tutorials: std::array, std::vector, std::stack, std::string, and std::sort, to name a few. Learning to use these effectively and appropriately is a great use of your time.

If you’re short on time (or patience), learning how to use the most common data structures and algorithms is the minimum you should do. But if you have the inclination, try recreating those data structures yourself, from scratch. It’s really good practice on writing reusable code, and will help you down the road when something you need isn’t in the standard library. But then throw them out, and use the ones in the standard library. :)

The C++ standard library

The bulk of the C++ standard library is data structures and algorithms. However, the standard library contains other things too, and another next step could be to explore those. Among other things, there are numerics (math) libraries, input/output routines, functions to handle localization and regionalization, regular expressions, threading, and file access. Every new release of C++ (which has been happening about every 3 years now) adds a batch of new functionality into the standard library. It isn’t critical that you know how everything in there works, but it’s worth at least being aware of what exists, so that if you happen upon the need for it, you can go learn more as needed. https://cppreference.com/w/cpp is my go-to reference for discovering what exists.

Graphical applications

In our tutorial series, we developed console applications, because they’re easy, cross-platform, and don’t require installing additional software. Unlike many modern programming languages, C++ does not come with functionality to create application windows, or to populate those windows with graphical elements or graphical user interface widgets (checkboxes, sliders, etc…). To do those things in C++, you’ll need to enlist the help of a 3rd party library.

Getting a graphical application up and running requires a few additional steps. First, you’ll need to actually install the 3rd party library and connect it to your IDE, so you can compile it into your program. Most graphical libraries should come with instructions on how to do this for the most popular IDEs. Next, you need to instantiate an OS window, which requires calling certain function from the toolkit. Most, if not all, of the libraries should have sample programs that you can compile and dissect if you’re not sure how to do something basic.

There are a lot of libraries out there, and which one you should use depends on your requirements (you’ll have to do your own research to determine which one is right for you). Popular choices include Qt, WxWidgets, SDL, and SFML. If you want to do 3d graphics, all of these frameworks support OpenGL, and there are great OpenGL tutorials on the internet.

Graphical applications typically run differently than console applications. With a console application, the program starts executing at the top of main() and then runs sequentially, usually stopping only for user input. Graphical applications also start executing at the top of main(), typically spawn a window, populate it with graphics or widgets, and then go into an infinite loop waiting for the user to interact with the window (via mouse click or keyboard). This infinite loop is called an event loop, and when a click or keypress happens, that event is routed to the function(s) that handle that type of event. This is called event handling. Once the event is handled, the event loop continues to run, waiting for the next bit of user input.

TCP/IP / Network programming (aka. the internets)

These days, it’s pretty rare to find programs that don’t connect to the internet, a back-end server/service, or leverage the cloud in some way. Any program that requires you to have an account and log in is connecting to a server and authenticating a user. Many programs connect to some service to check whether an update is available. Social applications maintain a persistent connection to a social infrastructure, to allow users to communicate with each other on demand. These are examples of networking.

Networking (broadly) is the concept of having your program connect to other programs, either on your machine, or on network-connected machines, to exchange information. Networking is a powerful tool -- in the past, if you wanted to change the behavior of your application, you had to release an application update. Now, with some good program design, you can simply update information on a server somewhere, and all instances of the program can leverage that change.

As with many things C++, there are libraries out there to help make your C++ programs network capable. The Asio C++ library is a commonly used one (there are two variants -- a standalone version, and a version that integrates with Boost, which is a library that provides a lot of different functions, much like the standard library).

All of the programs we’ve seen in this tutorial series run sequentially. One task is completed, then the next one starts. If a task gets stuck (e.g. you’re asking the user for input and they haven’t entered any yet), the whole program pauses. This is fine for simple academic programs, but not so great for actual applications. Imagine if your program couldn’t handle the user clicking on something because it was busy drawing something on the screen, or if the whole program paused/froze when a network call was happening. The program would feel unresponsive.

Fortunately, a method exists to allow programs to execute multiple tasks at the same time. This is called threading. Much like how (most of) you can walk and chew bubble gum at the same time, threading allows a program to “split” its attention and do multiple things in parallel.

For example, some graphical applications (such as web browsers) put the rendering (drawing graphics) portions of the applications on a separate thread, so that updating the screen doesn’t block other things (like accepting user input) while the drawing is happening. Network calls are often done on separate threads, so that if the network call takes a while to resolve, the application doesn’t grind to a halt while its waiting.

Threading is powerful, but it introduces additional complexity, and a lot of room for additional errors. Therefore, I wouldn’t recommend starting here -- but it is a good area to learn about eventually, especially if you want to do complex graphical applications or network programming.

Another option is to spend time improving your understanding of best practices. For this, I highly recommend having a read-through of the CPP Core Guidelines, with an optional delving into the GSL library.

A good bye!

At this point, I’d like to take a moment to thank you for stopping by and reading this tutorial series. I hope you enjoyed your time here and have found this site useful. Special thanks to those of you who have helped keep this website a free resource available to everyone by viewing ads that interest you. Please drop by again!

Good luck (and skill) in your future endeavors, and happy programming! And remember, old programmers never die -- they just go out of scope.

-Alex

PS: If you have any feedback or other suggestions for things to explore next, please mention them in the comment section below.

 No next lesson Index B.3 -- Introduction to C++17

### 285 comments to C.1 — The end?

• Nirbhay

Hello Alex!

I am not yet done with all the lessons but would like to suggest a topic for future tutorials.

You explain everything in detail, which is really easy to grasp for a beginner. Therefore, I think it would be really nice to have a tutorial on 'CMake'. It is a widely used build system but the tutorials are not so great. One can see 'CMakeLists.txt' file almost everywhere.

If possible, please consider this in the future!

Thank you :)

• Alex

Thanks for the suggestion! I'll put this on my ever-growing to-do list. I'm starting to feel like George R R Martin -- I can't write fast enough these days... :)

• Hi Alex!

Here we go again:
- "I didn't include X but my code still works if I include Y". Transitive inclusion depth is implementation-defined. Often times implementations include headers that are not required to be included per the standard. If a transitive include works on one system, it might not work on another.
- Compiler settings are per project. They need to be applied to every new project or saved as a template.
- Member functions not being marked as `const`.

Passing/returning non-fundamental types by copy is still common. I suspect the 3 chapter gap between `std::string` and `struct` to "passing by reference" is too big.

• DangerousVanilla

I finally made it through the entire site. It's crazy that I started this at least a couple months ago. You've created an incredible resource here and for that I thank you. Everything is so well put together and I really appreciate the fact that you continue to update this information from feedback and the new standards as they’re released.

I’ll be honest though; I don’t think I could recreate a lot of the advanced topics from scratch. As I progressed through the tutorials it became increasingly difficult to remember the details of each topic. It just seemed to snowball to a point I could no longer retain everything I was reading. I could have probably practiced more, I’m sure that would help a lot. Despite the difficulty I started having, I recall reading something to the effect of “C++ is 50% knowing and 50% being able to look stuff up”. I can’t recall where I read it, whether in a lesson or a comment, but I believe it was at least on your site.

Anyway, it really stuck with me as meaning that even an experienced programmer won’t necessarily retain everything. That kept me motivated to at least finish reading everything. I now at least know of the existence of most everything here and can refer to it as necessary. Thanks for taking your time to create and maintain these tutorials. It’s honestly the greatest resource I’ve ever come across while trying to learn programming of any kind.

• Alex

Yup, that comment was from this site, in lesson https://www.learncpp.com/cpp-tutorial/developing-your-first-program/

And you're welcome. Thanks for leaving feedback. It's always particularly interesting for me to see how long it takes people to make it through all the material.

• cdecde57

Thank you Alex and nascardriver.

I started learning from this site

3-20-19

It took me 5 months and a week to finish these tutorials and I have loved it here. Thank you for always replying to my problems and always providing a great solution. Sense I have finished these tutorials I will move onto SFML and learning how to do networking and hopefully find out how to do OpenGL and multi-threading over time. I still forget things or screw things up but I have taken notes so I can re-remind myself of what I forget.
Again thank you for these tutorials. This is the first place and only place I have ever gone to, to learn c++ and I truly feel that I know so much now. Thank you for everything and all the pointers and tips.
Thank you for all the other sites you have told me I can visit and learn from I will certainly do that.

I have learned everything I know about c++ from this site and you guys and it has truly been amazing. I want to head into game programming / development and / or into creating applications like calculators or just in general any application. Yes, its broad but any tips for things I can do to prepare for these would be great.

The journey has been incredible. Sometimes I will forget how to spell a certain thing but thank goodness that I can just come back here and remember what it was called. (example remembering how to spell iomanip). Its been great and really thanks for everything. This is the first programming language I have ever learned. I was told c++ is not a good one to learn because of the difficulty but to be honest you guys taught it so well it was not hard at all. I will continue to study the notes I have taken and do my best to learn more.

Thank you for everything its been great!

• Hi!

Good to see one more person finish these tutorials, not everyone makes it to the end :)
Now it's important that you don't take a break from programming, because you'll forget everything. Start with something easy, eg. your calculator. You can use qt, which is the market leader in guis. Take your time, try to write good code.
Once you feel like you know everything that was taught here, go through all the language updates from C++11 to C++2a and apply the new content to your calculator.
When you start the next project, maybe a small game, you can use new language features right away.

• cdecde57

Thank you for the tips! I will certainly learn QT.
I started a little SFML from their website but I have NEVER dealt with ANY programming or game developing topics and although I understand the loops the main window ect when I got into graphics they started using these algorithms like,

I understood about sprites and creating classes to help draw out multiple things.

although I understood almost all of the algorithms after looking it through they never really explained why they did what they did. Now this is OK because I was able to look through and understand why they did it but, its still confusing at times to understand certain topics especially noting I have not had prior knowledge to what I am doing. I am going to pause SFML and move into QT. As I previously stated I have NEVER had game developing experience or in general experience with programming until I found this place and learned C++ from you guys. (which by the way it was amazing!)

Anyways I will try doing QT and if you know anywhere I can go especially when and if I don't understand an algorithm they use or something, any information would be great. I know about stackoverflow but any thoughts would be great.

I will continue to program the best I can. I know I wont ALWAYS be able to code (ill have to head off to college etc). But I will for sure at least try non-stop (with school going), for about a year till I have to continue school education etc.

I love it here at learncpp.com and I will probably still visit from time to time for suggestions or tips.

Thanks again for the wonderful site. I have learned so much from this place and now trying to learn more. :D

• I don't use qt myself, so I can't recommend you anything to learn from.
If you don't understand something about cpp, cppreference is the place to go. If you don't understand something about a function in a library, you'll need to look at the libraries documentation and/or forum.

• cdecde57

Alright, thanks!

:D

• anon

i havent finished the lessons yet im just here suggesting that you should make the ads less in ur face so then people may start whitelisting the website on their adblocker

• Atas

A big heartfelt thank you to Alex and nascardriver for creating the tutorial and answering a ton of pesky questions I've had along the way! I can only imagine the amount of time and effort that was put into this project and let me tell you: it was 100% worth it. The result is fantastic and it's getting better still with each update and each answered question. The number of people LearnCpp has helped must've overflowed all possible buffers. Thank you ♥

• Michael

Hello, thank you for the great tutorial series!

programming parallelism.

I've already done some research on the topic, but I haven't
found a reliable source to start learning (a website like this,
for example).

• Alex

I haven't found one either (then again, I haven't looked extensively...)

• Hi Alex!

My most common/important remarks, without those of last month:

- Lines exceeding 80 characters in length.
- Passing/returning non-fundamental types by value as opposed to reference.

In lesson 5.9

And seeding random number generators multiple times is pretty common.

• Alex

Thanks Nascardriver! This aggregated feedback is super-useful.

1) I emphasized the line length more in lesson 2.6.
2) Reinforced using pass by reference for class types in lesson 7.3. I plan to move this lesson up in the future, so it will get reinforced earlier.
3) Updated the code in lesson 5.9 as you suggested.
4) Added a rule to lesson 5.9 explicitly mentioning that RNGs should be seeded only once, as added reinforcement.

• Vir1oN

Dear @Alex

I came across your website after graduating from high school about two months ago, and these were the most productive two months in my life!
Thanks to your writing style, the way you explain the material, after about 10 minutes of searching for c++ tutotials I knew I was going to go through and finish this one, which eventually has happened. There were really few moments, considering the amount of topics, where I was confused, and in such cases you and @nascardriver always helped me out. I almost envy your real-life students! Having such a teacher in an university must be a real pleasure.

I also have one minor suggestion: I feel like late chapters (from templates and further) need a bit of practical tasks, like quizzes from earlier ones. I understand that you probably have a ton of things in your to-do list, but I think it would be nice if people had more time to master those topics (especially templates, which I had to go through twice to get a clear understanding).

Thank you for all you`ve done for us.

Regards,
Taras

P.S: My special thanks to you, @nascardriver. Answering all of my dumb questions and cheching through my code must have been a real pain! Please don`t get offended for mentioning you in the postscript section, I just didn`t want to litter the comments :D

• I'm glad I could help you! If you have any further questions in the future, don't hesitate to come back :-)

• Vir1oN

Won’t miss that chance!

• Alex

Thanks for the feedback. The later lessons are light on quiz material for sure. I'll make sure my to-do is clear that this is a need.

• Alexander S.

Hey Alex, I'm not done with everything yet, but where do we go to develop skill more after finishing?

• Hi!

They best thing you can do is start a project that you're genuinely interested in.
If you can't think of anything,
do coding challenges to stay in touch with cpp and learn about algorithms.
Other than that it depends on what you're looking to do in the future. You'll probably need to know about multi threading (on cppreference) or parallel programs on the GPU (OpenCL, CUDA). You might need user interfaces (Qt) or rendering (OpenGL, Vulkan). You might need advanced maths (I don't know, probably not in cpp).

• Mark D

Hey Alex,

I finished reading your entire C++ tutorial. I wanted to say thank you for a free and easy-to-understand reference. In particular, I really enjoyed your chapter on virtual functions and polymorphism. (A special thanks also goes to nascardriver whose explanations in the comments section were very helpful.) Your tutorials will now be one of the references I'll lean to when I need to understand or review a C++ topic.

I do like nascardriver's May 29, 2019 idea on having a lesson on how to read std library documentation. That would be helpful for sure.

Once again, thank you.

• Alex

Thanks for the feedback!

• Hi Alex!

My most common remarks this month:
- Using double quotes instead of single quotes for characters ("\n" vs '\n' mostly). Single quotation marks should be used to allow overload selection to select an optimized version of the function being called.
- Using postfix++ instead of ++prefix even if the result is unused. I suppose the majority of the people doing this are used to postfix++ from languages where it doesn't matter what you use. Highlighting the problem of postfix++ with regards to user-defined types (Unnecessarily copying large amounts of data) could make people think twice before using postfix++.
- Inconsistent formatting. The auto-formatter should be part of lesson 2.6.
- Using int literals in double calculations. If the result is supposed to be a double, then double literals should be used in the calculation to prevent integer arithmetic.

I think introducing `goto` before introducing loops is a bad idea. If you swapped them, people would reach the lesson about `goto` and think "I already know how to do this, I don't need `goto`", which is what they should be thinking. `goto` isn't something I point out often, but more often than I'd like to.

• Alex

Hey Nas, awesome feedback! I'll figure out where to best incorporate these. Much appreciated!

• RAGHAV

HI ALEX
THANQ SO MUCH FOR THESE TUTORIALS.
THESE ARE THE BEST ONES I FOUND ON INTERNET.
I WISH YOU EXPAND THEM INTO DEEPER TOPICS.

• Felinor

Just the best of the best lessons I've met! Many things that were incomprehensible to me, I was able to master thanks to your site. Thank you so much for being my tutor in programming.
Keep doing what you are doing!

• Musa

Great read from start-to-end, all the best Alex!

• FraznoFire

Hi Alex, I haven't finished the tutorial yet but I just thought I'd have a squizz at this page.
so far your tutorial is the most informative one I have found on the internet and it is really helpful
just wanted to say thanks a lot for this, it is truly a gift.

• Hi Alex!

A lesson about how to use an std library documentation would be nice (cppreference/cplusplus). This might not need an entire lesson, since those sites are pretty self-explanatory.

• Alex

I like the idea, as leveraging reference documentation is a natural progression beyond learning tutorials. Are there things you see that might be particularly worthy of explanation?

• - The std library is filled with templates and overloads, a brief introduction is required to understand the documentation.
- Add a little more talk about C++ versions, since seeing all overloads of all C++ versions can be quite overwhelming for a beginner. Knowing that they don't need to pay much attention to the old versions can help.

When that's done, I'd just go over 1 or 2 examples of navigating through a reference and explaining the structure of the site of your choice.

• Alex

Thanks, that's helpful. Saving this comment for later. :)

• Rodrigo

Hi Alex,

I could not finish this tutorial without leaving you a special word. It must be said that this website is not just for learning c ++ ... it is a site to think about and learn how to program any programming language. Practically all the major concepts of programming are described in this tutorial. I was undoubtedly fascinated by how this page teaches and describes the themes in a direct, synthetic and always with several references to previous chapters in order to remind important concepts. This is the spot that anyone who wants to learn to program should consult, because everything is exposed in a clear way and in order to open horizons. Everything that is core in programming is here exposed and clean. My congratulations to Alex for the writing, because it is incredibly well done and deserves of all my appeal. This page has all the potential needed to continue evolving with C ++ itself. Continue to complete this tutorial even more and never fail to do so, because it is indeed very well done.

• Alex

Thank you for the generous praise!

• alexander

hello hello!

how are you alex

i love so much your tutorial and I wish I had some money to donate to you 20\$ YOU HELPED ME SO MUCH ABOUT C++

now i can make my games!!!
thank you sooooooooo much :) :) :) :) ;)

• WOW!!! Thanks Alex for this good tutorial :)

• lyf

Thanks Alex,

I'd like to say your tutorial is the best one i can find on the internet. Because it's not like a user manual or dictionary. I'd like to name it "practical cpp" if you like. I hope you fill the blanks "no tutorials" mentioned at "https://www.learncpp.com/cpp-tutorial/b-1-introduction-to-c11/ if you have time.

Thanks again.

• Alex

You're welcome. Yes, the intent is to eventually fill in the content from C++11/14/17 that is missing. Not sure when I'll get to it though.

• Vodka

unique_lock can be unlocked and locked when lock_guard can't be unlocked (unlocks on destruction)
defer_lock used as second argument for unique_lock for making it by default unlocked (unique_lock not owning lock)
try_to_lock also used as second argument for unique_lock for trying to lock object (instead of deadlocking).
Also I can recommend this lambda tutorial: https://gitlab.com/Cre3per/learncpp/blob/master/extra/7/15.md
Next thing i want to learn this is graphical applications.
Question for everyone: Which graphical application library you will recommend?
Sorry for my English, i'm Russian.

• Alex

Multithreading and lambdas are on my to-do, but I won't get to them soon.
For graphical libraries, Qt, SDL, and SFML are popular libraries for graphical applications. There are others, but these tend to get recommended the most.

hi Alex,thank you for your good tutorial, can you make a lesson about multi threading and parallel programming.

• Alex

It's on my to-do but I'm sure I won't get to it anytime soon. :(

• David

Thank you for these tutorials Alex! You've made learning C++ so accessible, and explain everything in a way that makes sense.

• Mustafa

is there a way to print the site as a text book i really loved the site & i really thank u for all what u did ur site is amazing it's much better than many other tutorial out there.

form somewhere nearby the great pyramids of GIZA ^^^ say that to u "love u so much".

• Artem

Alex, thank you very much! Perhaps you will do a lesson on working with the database?

• Alex

Probably not, as C++ does not contain core language functionality to work with databases. I'm trying to stick to core functionality before branching out into things that require third party libraries.

• Artem

Alex, can you make a lesson about lambda expressions?

• Alex

It's on my to-do list. Not sure I'll get to it soon though.

• Hi Artem!

I gave it a shot
https://gitlab.com/Cre3per/learncpp/blob/master/extra/7/15.md
Let me know what you think!

• JD

SQLite is a pretty good place to start. It's relatively simple to set up and work with. In a Visual Studio project you just have to do 3 or 4 little, easy things to make it work. If you're familiar with SQL at all you can do nearly anything in SQLite with like 3 functions.

• Vijay

Hi Alex, could you please suggest books or websites for recommended topics like data structures, algorithm etc?

• Cyrale

Thanks a lot for writing these tutorials, transitioning from C and C++03 to C++11-17 became a lot easier thanks to those. Do you need help with hosting? I think it would be nice if these tutorials had no ads, I have a server with a spare 50Gb that I'd be happy to use to host tutorials like these.

• Alex

Thank you for the offer. One benefit of my current host is that they provide managed hosting -- in addition to applying various security patches, they also investigate any issues that occur. This helps minimize downtime and keeps the site healthy, which is important for long term operation. If you really hate the ads, you can always install an ad blocker.

• Cyrale

I was reading those on my phone, and mobile chrome doesn't support browser extensions :p

(P.S. some pages completely break on mobile due to non-responsive tables)

• Hello Alex and everyone.
thanks Alex for the lessons.
i have studied all the lessons in this.

now i want to learn Python, so can you tell me some courses that at least the same as here  (someone was studied)?
thank you so much. i waiting for the answer of anyone.

Thanks again!

• Julius

Hey Mait,
I am unfortunately not Alex but I do have some thoughts on learning Python.

Non-free Resources:
- Python for Dummies (book)
( I haven't read it but every for Dummies Book I have read so far is great so don't be opposed by its name

free Resources:
(codecademy is excellent if you learn by doing since every tutorial is well illustrated and interactive)

There are also some suggestions from the python community at Python.org
https://wiki.python.org/moin/BeginnersGuide/Programmers