I would suggest getting the book called: "Absolute C++" by Walter Savitch. It's a big ass book and is pretty good, covers a range of topics. I think you can go through the book from start to finish.
Anyways while doing that set a bunch of goals for yourself, like making a calendar program, or a calculator or something like that. Then create those programs. Just practice your problem solving along the way and you should get pretty good at C++.
Or if you get bored with reading C++ books or maybe you're reading things you already know, and you have lots of bus time; The tutorial on this website is very cut down and a light read, read it on the bus again and again until you are familiar with all the various aspects of the language. This source was the most beneficial for me. After that I just worked on my own projects, learnt just as much on top of the tutorial.
So the tutorial then working on your own project is a very simple but effective way to learn.
//taken from the book of c++everyone except for the class part
#include <iostream>
#include <string>
using namespace std;
class getkey
{
public:
~getkey()
{
cin.get();
}
};
int main()
{
getkey *x;
string credit_card_number = "4123-5678-9012-3450";
int i = 0;
while (i < credit_card_number.length())
{
string ch = credit_card_number.substr(i, 1);
if (ch == " " || ch == "-")
{
string before = credit_card_number.substr(0, i);
string after = credit_card_number.substr(i + 1);
credit_card_number = before + after;
}
else
{
i++;
}
}
cout << credit_card_number << endl;
x->~getkey();
return 0;
}
now i would like to ask a explanation how does this code remove the "-" and "space"?