Hi,

In University we have been taught to declare variables at the top, eg:

Code:
int x;
int y;
string name;
etc.......
However, working through Accelerated C++, they use a different approach, for example:

Code:
cout << "Please enter your name: "
string name;
cin >> name;
Which is the better option here? I prefer the second as taught in ACPP.

Thanks.