I recently installed Ubuntu on a PC, and I got code::blocks for it. The problem is that even when I declare header files I still have to point to the functions using the std::. Does this mean I should just do usingnamespace std instead? Or is there something I'm doing wrong?
Technically you should use usingnamespace std; anyways if you're using cout, or at least using std::cout;
AFAIK nothing automatically causes it to use std by default.
No no what I mean is that in Windows the header file <iostream> includes the stream functions, so I never needed usingnamespace std in the first place; but Ubuntu doesn't seem to acknowledge it.
No worries I understand what the issue is now. Thanks
That's sort of weird...now i'm interested.
<iostream> includes the commands, but it doesn't automatically make it so you're usingnamespace std;
What compiler were you using?
The only standard library I know of where cout is not in the std namespace is VC++ 6.0, because it's previous to the 1998 standard. It's likely all older compilers are like that, as well.
Any compiler that lets you use cout without specifying using namespace or without std::cout, is wrong, and you should not use it for new projects.