June 01, 2002 Typedefs | ||||
|---|---|---|---|---|
| ||||
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?
| ||||
June 02, 2002 Re: Typedefs | ||||
|---|---|---|---|---|
| ||||
Posted in reply to John Lance | 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?
| |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply