title: Using :: (scope resolution operator) in C++
body: <p>I am learning C++ and I can never tell when I need to use <code>::</code> . I do know that I need to use <code>std::</code> in front of <code>cout</code> and <code>cin</code>. Does this mean that inside of the <code>iostream</code> file the developers that created it  made a namespace called <code>std</code> and put the functions <code>cin</code> and <code>cout</code> into the namespace called <code>std</code>? When I created a new class that isn't in the same file as <code>main()</code> for some reason I must add <code>::</code> .</p>
  <p>For example, if I create a <code>class</code> called <code>A</code> , why do I need to put <code>A::</code> in front of a function that I make, even though I didn't put it into a namespace? For example <code>void A::printStuff(){}</code> . If I create a function in <code>main</code>, why don't I have to put <code>main::printStuff{} </code>?</p>
  <p>I know that my question is probably confusing, but could someone help me?</p>