+ 5
Why do you recommend "using namespace std"?
I've seen it coud be problematic and dangerous to use namespaces like this in real coding, why does it show in your c++ tut.?
4 Antworten
+ 7
I wouldn't recommend it. Especially not in header files (due to namespace pollution).
I believe similarly - the C tutorial shows you how to get a string using gets() which is a deprecated function with potential for buffer overruns and should never be used. They should probably change those courses or add a warning of some kind.
+ 10
You probably would not like using std::cout everything you want to output something, just cout would be better wouldn't it? Same for cin as well.
+ 4
I think similar questions have been asked in the past. Did you try to search for them?
0
Using one namespace wouldn't hurt but if you're programming with a lot of namespaces then you may encounter some errors. These are dangerous especially if you're making a project cuz then one error could lead you to search through your entire code. "using namespace std;" wouldn't cause any problems but I would definitely not recommend using more more namespaces other than that.