Re: [C++] Having some troubles with ctors

From: Alwyn (dt015a1979_at_mac.com.invalid)
Date: 07/31/04


Date: Sat, 31 Jul 2004 13:47:06 +0100

I hope the OP has not become confused by the misunderstandings among
various people in this thread. Here is what the code should look like:

#include <string>

class a {
private:
  // got some stuff here
public:
  a(const std::string &s) {
    // using s.c_str() to pass to some platform spec.
    // functions to fill other data types not given
    // because they too go to platform spec stuff,
    // specifically TCP/IP related data stuff
  }
};

class b {
private:
  a objA;
  // some other stuff
public:
  b (const char* str) : objA(str) {}
};

int main()
{
  b b("Hello!");
}

Alwyn



Relevant Pages

  • Re: [C++] Having some troubles with ctors
    ... Alwyn wrote: ... > I hope the OP has not become confused by the misunderstandings among ... I wrote a member function in b that would initialize the ...
    (alt.comp.lang.learn.c-cpp)
  • Re: So long and thanks for all the fish.
    ... total misunderstandings". ... John does tend to go private after a while... ... Jeremy C B Nicoll - my opinions are my own. ...
    (comp.sys.acorn.misc)
  • poker odds
    ... public static final int HIGH_CARD = 0; ... private static Logger logger; ... public Poker(int numCard, Card deck) ... public void maxSimulation ...
    (comp.lang.java.programmer)
  • problem with vmr9 image compositor - method Draw
    ... I play video with playlist, if i play video about 5x it is ... but so 6round of video playing throw exception int ... private void ConfigureVMR9InWindowlessMode() ... Surface renderTarget = new Surface; ...
    (microsoft.public.win32.programmer.directx.managed)
  • Re: using ref keyword performance
    ... // private fields... ... int valueCount = values.Length; ... static void TestWithRefLoop() ...
    (microsoft.public.dotnet.languages.csharp)