Re: CMenusWin::CMenusWin() : m_str( m_szText, TEXT_SIZE )

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Strictly say m_str is class with two members ( one is char[] or
similar(string ) and second length ) or more, so first initialized with
value of m_szText and second ( length ) with TEXT_SIZE
Arkady

"SteveS" <SteveSpencer@xxxxxxxxxxxxxxxxx> wrote in message
news:C1C712F0-A5D8-403A-9D7B-2B21EBE2D6BA@xxxxxxxxxxxxxxxx
This is way off topic, being a straight C++ question, but I'm feeling
generous.

The single colon after the constructor argument list (which just happens
to
be empty in your case, permits the initialisation of members, or passing
arguments to the constructor of a base class. Effectively it's calling the
constructor for whatever m_str happens to be, passing two arguments.

The thing it's passing in, since the original c-tor argument list is
empty,
appears to be a member variable. Unless this is a simple type (I'm
guessing
some variation of char m_szText[TEXT_SIZE] ) this is not necessarily a
good
idea, since it may not have been initialised yet.

Further questions would be better in the C++ language newsgroups.
--
Steve S


"Muhammad Azeem Azam" wrote:

the first one the comstructor

whats the meaning of second colon

: m_str( m_szText, TEXT_SIZE )


.



Relevant Pages

  • Re: Protected static members, abstract classes, object composition vs. subclassing
    ... unpublished and unknown ECMA 262 4th edition, JScript.net and JavaScript ... combination of a constructor function and its prototype define a process ... Rendering something 'private' is a matter of making it ... 'Private instance members' may be created by having the constructor (or ...
    (comp.lang.javascript)
  • Re: Trying to understand Python objects
    ... the way it describes the way objects work with Python. ... One convention that you seem to be unaware of is that assigning ... initialisation method) so that each instance has a separate attribute ... When you create a new instance of a class, its constructor is called ...
    (comp.lang.python)
  • Re: Creating a C++ like message loop in .NET threaded classes.
    ... API functions I wrote a base class that starts a thread in its constructor ... >> writing a singleton class that, at run time, will have its members invoked ...
    (microsoft.public.dotnet.framework)
  • Re: Is CppUnit un-C++
    ... > members instead of pointers. ... class type members as opposed to using pointers to class types as members. ... The issue of header files is really irrelevant in this case. ... should be a constructor and tearDownshould be a destructor. ...
    (comp.lang.cpp)
  • Re: Programmer knowledge
    ... > initialisation takes place until you actually 'create' a window. ... > initialisation in the constructor. ... > peel are you eating a banana ineffectively? ...
    (comp.programming)