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.Code: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".Code:std::cout << "\nThis is a line of code!\n";
Code:#define myAge 25Code:const unsigned short integer myAge = 25;