[comp.lang.c] private static

Michael_Hoennig@hh.maus.de (Michael Hoennig) (06/18/91)

Hi Bob,

BB>1.  How do I explicitly initialise a private static member variable?
You _MUST_ define it like this:

class fred
{
        static int fd;          // file descriptor; 0 is legit
};

int fred::fd = -1;

BB>2.  The following pair of statements appears to be legitimate in C,
BB>    but not in C++:
BB>        typedef char byte;
BB>        unsigned byte thing;

This would be a bug in your C compiler. It treats typedef's as
defines. But typedefs aren't defines!

Adios

--
Michael Hoennig -- Dobbelersweg 45 -- D-2000 Hamburg 26 -- ++49 40 219 24 58
office: mi1@starlab.UUCP -- ++49 40 23 08 56 (StarDivision Hamburg)