initializing a class member

initializing in member list ?

1
2
3
4
5
6
7
8
9
  class myclass
  {
      int member { 1 };
      public:
      void showmember( void )
      {  std::cout << member; }
  };

/* this looks ok. I can cout it, anything wrong with this ?*/

Yea it's a perfectly legal thing to do in classes with newer compilers.
Thanks for a fast reply.
I started out with C with classes.
Topic archived. No new replies allowed.