Which of the following is a reason why using this line is considered a bad practice? (Alternative: Why is using this line considered a bad practice?)

Advertisement

Using namespace std;

  • The compiled code is always bigger because of all of the imported symbols.
  • If the code uses a function defined in two different libraries with the same prototype but possibly with different implementations, there will be a compilation error due to ambiguity.
  • It automatically includes all header files in the standard library (cstdint, cstdlib, cstdio, iostream, etc).
  • It causes the compiler to enforce the exclusive inclusion of header files belonging to the standard library, generating compilation error when a different header file is included.
Join our list

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for subscribing.

Something went wrong.

Leave a Comment

Share via
Join our list

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for subscribing.

Something went wrong.

Send this to a friend