Hey guys, I have a really simple question that I doubt you'll find any trouble answering. Does any of you guys know where I can learn C++? What's the best website you know, and thank you.

Dani AI

Generated

Short, practical roadmap for that builds on the good suggestions already here from , , and .

Start small, build up. Pick one clear introductory book or guided tutorial (so you avoid flitting between dozens of references). Learn the syntax with tiny programs, then immediately use the standard library to solve real problems — containers, algorithms, string handling. Try a small project (file parser, todo app, simple game) and expand it incrementally.

Suggested learning sequence to follow in order:

  1. core syntax and functions, 2) containers and iterators, 3) resource management and RAII, 4) classes and polymorphism, 5) standard algorithms and lambda expressions, 6) move semantics and smart pointers, 7) templates and concurrency when you need them. Combine a top-down project approach (build something useful early) with bottom-up study of language rules, as @vijayan121 noted.

Example of a tiny, idiomatic snippet you can type, compile and tinker with to see STL + lambda in action:

#include <vector>
#include <algorithm>
#include <iostream>

int main() {
    std::vector<int> v{1,2,3,4,5};
    int threshold = 3;
    auto cnt = std::count_if(v.begin(), v.end(), [threshold](int x){ return x > threshold; });
    std::cout << cnt << '\n';
}

Practical tooling and pitfalls: enable warnings and fix them (treat warnings as errors while learning), use sanitizers (address/undefined), run a debugger, and use version control. Avoid manual new/delete; prefer RAII and smart pointers. Read short real projects and refactor; that practice teaches idioms far faster than reading examples in isolation. The sticky threads and tutorial pointers already recommended in this thread are useful — use them as a source of practice problems rather than a catalog to consume.

Recommended Answers

All 4 Replies

Welcome .

Please visit the sticky threads - c++ books and C / C++ FAQ's and Practice problems of cplusplus board.

I always recommend learncpp.com as a great starting point. Very easy to follow.

Does any of you guys know where I can learn C++? What's the best website you know

Perhaps you would want to consider learning to use C++ in the most effective way along with learning C++. Rather than join a whole generation of programmers who started to learn the most primitive level at which one can use C++, and then continued to program for ever at that level, I would suggest a 'top-down' approach where you learn the language, the library and learn by using these to solve programming problems.

I don't know of a web resource that teaches C++ this way; perhaps you could invest in buying one first C++ book and then look at the web for additional resources. Koenig and Moo's "Accelerated C++ - Practical Programming by Example" http://www.acceleratedcpp.com/ is a good first introduction to C++.

A good book (freely available on the web) that teaches C++ in the traditional way - starting at low-level C-like aspects and then moving on to higher abstractions - is Eckel's "Thinking in C++" http://www.mindview.net/Books/TICPP/ThinkingInCPP2e.html

Some other resources you may find useful:
"C++ Annotations" from University of Groningen http://www.icce.rug.nl/documents/cplusplus/
Informit's C++ Reference Guide http://www.informit.com/guides/content.aspx?g=cplusplus
Tutorials etc at cplusplus.com http://www.cplusplus.com/

A couple of newsgroups where people learning C++ can ask questions or seek clarifications on doubts and expect to get good answers:
alt.comp.lang.learn.c-c++ http://groups.google.com/group/alt.comp.lang.learn.c-c++/about
comp.lang.c++ http://groups.google.com/group/comp.lang.c++/about

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.