::func()
means that this function is not affiliated with any specific class. It is used when there exist many functions with the same name, and to avoid confusion between the one you want and specific member functions you precede the function name with the scope operator.
From C++ Primer, 4th edition, section 17.2.1:
"Names defined at global scope - names declared outside any class, function, or namespace - are defined inside the global namespace. The global namespace is implicitly declared and exists in every program. Each file that defines entities at global scope adds those names to the global namespace.
The scope operator can be used to refer to members of the global namespace. Because the global namespace is implicit, it does not have a name; the notation
::member_name
refers to a member of the global namespace."
link
after the answer. – Schonthalstd::atof()
.::atof()
means that you have included<stdlib.h>
and want the global version,std::atof()
means that you have included<cstdlib>
(like a good C++ programmer) and want the version in thestd
namespace. – Henigman