see these code(i know that isn't correct):

Code:
class test
{
      public:
           void Printed(){};
           void write(string a)
           {
                    cout << a;
                    Printed();
           }
};


test a;

void a::Printed()
{
     cout << "\nmessage printed\n";
}

int main()
{
      a.write("hello world");
      return 0;
}
how can i change the Printed() for be valid with '::' with an object?