c++ - Typedefs
- John Lance (16/16) Jun 01 2002 I am trying to do a typedef that I used to be able to do with another
- Jan Knepper (4/20) Jun 01 2002 Try:
I am trying to do a typedef that I used to be able to do with another compiler. it is: typedef char[80] char80; with the result to create a type that causes the compiler to create/reference an 80 character sized memory space of type char. I think I may have the syntax wrong, but can the above be done with the DigitalMars compiler? I have done typedef struct { char item[80]; } char80; but this is not so simple under some circumstances in accessing the data. With byte alignment, the above struct works fine though with many functions that use void * or with casting (ugh). What say you folks to this and am I too far left or right of standards?
Jun 01 2002
Try: typedef char char80 [ 80 ]; Jan John Lance wrote:I am trying to do a typedef that I used to be able to do with another compiler. it is: typedef char[80] char80; with the result to create a type that causes the compiler to create/reference an 80 character sized memory space of type char. I think I may have the syntax wrong, but can the above be done with the DigitalMars compiler? I have done typedef struct { char item[80]; } char80; but this is not so simple under some circumstances in accessing the data. With byte alignment, the above struct works fine though with many functions that use void * or with casting (ugh). What say you folks to this and am I too far left or right of standards?
Jun 01 2002