Re: [C++] Having some troubles with ctors
From: Alwyn (dt015a1979_at_mac.com.invalid)
Date: 07/31/04
- Next message: Chris \( Val \): "Re: [C++] Having some troubles with ctors"
- Previous message: Francis Glassborow: "Re: [C++] Having some troubles with ctors"
- In reply to: Andrew Falanga: "[C++] Having some troubles with ctors"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Next message: Chris \( Val \): "Re: [C++] Having some troubles with ctors"
- Previous message: Francis Glassborow: "Re: [C++] Having some troubles with ctors"
- In reply to: Andrew Falanga: "[C++] Having some troubles with ctors"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|