P
Pmb
I've noticed a lot of people preferring std::cout over cout. May I ask why
you prefer one over the other?
thanks
Pmb
you prefer one over the other?
thanks
Pmb
Pmb said:I've noticed a lot of people preferring std::cout over cout. May I ask why
you prefer one over the other?
'cout' is half as short to type. OTOH, to use it you need to declare
the name 'std::cout' as _used_ in the current scope, which is commonly
done by means of 'using' declaration, which in itself a kind of blanket
statement. Often, you might not want to bring the name into the scope
and instead use the "full" form. You know, like calling somebody "Mr.
Firstname Lastname" instead of "sir".
I prefer using most of standard types and objects with the namespace
prefix, unless I am being lazy, in which case I usually just say 'using
namespace std;'.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.