please how do i learn c++,

Recommended Answers

All 4 Replies

There are many many ways, and in my opinion most depend on why you want to learn C++.

If it is career learning then I would suggest you look for a class at a local college or school.

If it is for hobby then I would suggest you search web for tutorials.

I used http://www.learncpp.com/ a lot, but there are many more.

Understand that these are just two suggestions and there are other options such as online classes etc...

C++ == C with classes.

The key here are "classes" - this is a critical part of object-oriented programming (OOP). OOP allows much better modelling of real-world constructs than do "traditional" functional programming constructs do. An object is an instance of a class, which contains member data (values specific to the instance), and methods to operate on the instance and its members. Here is a "trivial" example:

struct date {
    unsigned year;
    unsigned month;
    unsigned day;
};

class person {
private:
    // Member variables here.
    std::string m_name;
    std::string m_address;
    date m_dob; // Date of birth.
public:
    person();   // Declaration of a person - implemented in person.cpp
    person( unsigned DOByear, unsigned DOBmonth, unsigned DOBday )
    { setDOB(DOByear, DOBmonth, DOBday); }
    person( const person& cpy ); // copy constructor (make clone) - see above.
    person& operator=(const person& rhs); // Makes one person a clone of another.

    void setDOB( unsigned year, unsigned month, unsigned day ) // Sets date of birth
    { m_dob.year = year; m_dob.monnth = month; m_dob.day = day; }
    std::string getDOB(); // Returns date-of-birth as a string in YYYY/MM/DD format.
};

This is a very simple (and not really great) example of using C++ to writing OOP code.

hi,
C++ is very easy and comfort language if we well know in C.
To more about this language study or practice more about c and u will be best developer in c++ developer.

I'm agree with Suzie999
learncpp.com almost all the day open on my laptop

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.