Re: Requesting sample code!
- From: "Igor Tandetnik" <itandetnik@xxxxxxxx>
- Date: Thu, 6 Nov 2008 13:06:03 -0500
Guido Franzke <guidof73@xxxxxxxx> wrote:
I think, if you declare a struct this way:
typedef struct strMystr
{
int m_i1, m_i2;
int get_values(int& i1, int& i2);
} SMystr;
then a constructor is not made automatically by the compiler (?).
Technically it is. But since it's a trivial constructor and doesn't do
anything, you might not find any traces of it in the generated machine
code.
class SMystr
{
public: // a public class
int m_i1, m_i2;
int get_values(int& i1, int& i2);
};
But in a class like here the compiler generates default
constructor,destructor,operator=.
I don't know exactly what happens with structs.
The same thing.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
.
- References:
- Requesting sample code!
- From: Robby
- Re: Requesting sample code!
- From: Guido Franzke
- Re: Requesting sample code!
- From: Ben Voigt [C++ MVP]
- Re: Requesting sample code!
- From: Guido Franzke
- Requesting sample code!
- Prev by Date: manifest woes
- Next by Date: Re: Requesting sample code!
- Previous by thread: Re: Requesting sample code!
- Next by thread: VS2005 conversion of '\n\r' to 0x0D0A
- Index(es):
Relevant Pages
|