ANSWERS: 1
  • If you don't define a namespace then each time you use a function, object, whatever you have to tell it what namespace it's in. For example, if you have a line in a program using cout: cout << "Hello world!n"; That will most likely fail if you haven't included that namespace somewhere. You could also do it this way, without defining it: std::cout << "Hello world!n"; But putting that std:: in your program repeatedly would be a big pain. Defining the namespace up front gets you around having to do that. Hope that helps.

Copyright 2023, Wired Ivy, LLC

Answerbag | Terms of Service | Privacy Policy