And, for now
forget that that C++ has goto's. There are a couple of situations where they are valid for C code, and shouldn't be needed at all for C++ (return a value or use exceptions)
Use loops or functions to achieve your goals.
You are doing OK, (It's your second day).
If I could recommend anything, I would say stick to C++ data structures such as string (and the associated algorithms & functions), rather than the C style data structures such as char arrays, and functions such as strcmp.
Take a look at all the reference & article info at the top left of this page.
Some more picky things - just to break bad habits early:
Don't use
using namespace std;
- put
std::
before each thing in the std namespace (for things not used so much), or you can do this for things used frequently:
1 2 3 4 5 6 7 8 9 10 11 12 13
|
//include statements
using std::cout;
using std::cin;
using std::endl;
using std::string;
using std::vector;
//function declarations
//main program
//function definitions
|
Don't use system - there is an article why not in the articles section.
It is also a good thing if you don't mix C++ and C styles - I guess you don't really know the difference yet.
Hope all goes well & have fun!!