|
|
for(std::size_t i = 0; i < n; ++i)
std::anything
everywhere.. why you don't once write using namespace std;
above main function and not repeat always every where in your code
std:
: , alot of pro programmers on here like to use it so you don't accidentally override a built-in function/library with one of your custom ones.top + 1
so you must iterate there to get the results you are looking for.
using namespace std;
is bad. Google it.using namespace std;
. There are a lot of things in the std namespace and unless you have memorized them all you can't avoid name collisions.
alot of pro programmers on here like to use it so you don't accidentally override a built-in function/library with one of your custom ones. |
This is not related to performance at all. But consider this: You are using two libraries called Foo and Bar: using namespace foo; using namespace bar; Everything works fine, you can call Blah() from Foo and Quux() from Bar without problems. But one day you upgrade to a new version of Foo 2.0, which now offers a function called Quux(). Now you've got a conflict: Both Foo 2.0 and Bar import Quux() into your global namespace. This is going to take some effort to fix, especially if the function parameters happen to match. If you have used foo::Blah() and bar::Quux() then the introduction of foo::Quux() would have been a non-event. |
hash
unaware that there was already a std::hash function. When they tried to use their class it failed to compile.
main (int argc, char*argv[])
|
|