Search:

Type: Posts; User: Yarbles

Search: Search took 0.01 seconds.

  1. Replies
    24
    Views
    2,978

    Ahem, // initialise members to supplied...

    Ahem,



    // initialise members to supplied values
    planet::planet(const std::string& p, int w, float n) : plan(p), weight(w), newweight(n){}
  2. Replies
    24
    Views
    2,978

    An initialiser list is the preferred method for...

    An initialiser list is the preferred method for assigning values to data members in class constructors. For example:




    // initialise members to zero / null
    planet::planet() : weight(0),...
  3. Replies
    24
    Views
    2,978

    Blimey O'Reilly, where to start? ...

    Blimey O'Reilly, where to start?



    planet::planet()
    {
    weight = myweight;
    plan = myplanet;
    }
  4. Replies
    2
    Views
    1,079

    Or better still: struct person { string...

    Or better still:



    struct person
    {
    string name;
    double weight;
    };
  5. Replies
    5
    Views
    1,473

    Your problem is that although you have declared...

    Your problem is that although you have declared the static member _elems, you haven't defined it. Add the statement below after your class definition in order to define _elems:




    vector<int>...
  6. As far as function pointers are concerned,...

    As far as function pointers are concerned, non-static member functions are accessed via the pointer-to-member operators, whereas a static member function is accessed via a regular pointer. What I was...
  7. Hello 7stud. Whilst it is true that (class)...

    Hello 7stud.

    Whilst it is true that (class) static variables are created prior to main() being called, surely this is also the case for globals too, which in the example above compiles OK. Also,...
  8. static array of function pointers within class

    Hello. I'm trying to create a class containing a static data member which is an array of function pointers, but I can't work out the syntax to define and initialise it in the corresponding source...
  9. Replies
    2
    Views
    1,361

    Thanks. I think I need to experiment a bit with...

    Thanks. I think I need to experiment a bit with Get/SetFocus() to determine/set where the keyboard focus needs to be.
  10. Replies
    2
    Views
    1,361

    WM_KEYDOWN oddity

    Probably a simple explanation for this, but it's eluded me so far. If I check for a WM_KEYDOWN message in the window procedure for a completely blank dialog window (ie. no controls, buttons etc.),...
Results 1 to 10 of 10