Some beginner questions.
I am currently trying to learn C++ from a book (Sams teach yourself C++) and I had several questions.
Does using the following.
Instead of calling them again every time have any effect on the programs execution or is it just laziness? With calling them again every time I mean for example.
using namespace std;
Second, I see "#define" used a lot on this forum. According to my book "const" should be used instead. Why is it used so much on this forum? The book mentions that it used to be done like that but that it has been declared obsolete. Not to mention the advantages "const" has over "#define".
std::cout << "\nThis is a line of code!\n";
const unsigned short integer myAge = 25;
usings are just to bring in the namespace. Doesn't effect the program.
I prefer to be explicit:
const is usually the better choice. But there can be cases for the defines.