Original Post
🔒 Locked
std::
Advertisement
Its a namespace, followed by the scope resolutoin operator.
Namespaces are kinda like classes that can''t be made into actual objects (that is, you can''t say std Variable = 0) and all functions and variables inside it have to be static, so you can''t use -> or . to access the variables and functions.
Oh, and you can add to a namespace by declaring it again.
Namespaces are kinda like classes that can''t be made into actual objects (that is, you can''t say std Variable = 0) and all functions and variables inside it have to be static, so you can''t use -> or . to access the variables and functions.
Oh, and you can add to a namespace by declaring it again.
A namespace is like a sort of place where all the variable names, class names, etc. are kept. The usual namespace (i.e. when not using a namespace) is called the global namespace.
STL components use a namespace called std. When you''re coding, the compiler will not look for things in other namespaces, by default (this is to avoid multiple things with the same name). By writing std::bla, you indicate that bla is part of the std namespace, not the global namespace.
You can also use ''using namespace std;'' to tell the compiler that if it can''t find something, it should try looking in the namespace std.
STL components use a namespace called std. When you''re coding, the compiler will not look for things in other namespaces, by default (this is to avoid multiple things with the same name). By writing std::bla, you indicate that bla is part of the std namespace, not the global namespace.
You can also use ''using namespace std;'' to tell the compiler that if it can''t find something, it should try looking in the namespace std.
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement