Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > declare structure w/ mix alignment in project..

Reply
Thread Tools

declare structure w/ mix alignment in project..

 
 
nm
Guest
Posts: n/a
 
      05-04-2006
I create new prj w/ MSVC++ 6. This prj have compiler's option : Default
struct alignment == 8 /Zp8

so i don't know how do i declare myStruct w/ no alignment (align(1)).

i declared
__declspec(align(1)) struct tagMAB_CODE_HEADER{
uint8 iID;
uint8 iSection[8];
uint16 iLength;
uint8 iCmdID;
uint8 iResponse;
} ;

typedef struct tagMAB_CODE_HEADER MAB_CODE_HEADER;

but it's not work ?

nm.

 
Reply With Quote
 
 
 
 
Victor Bazarov
Guest
Posts: n/a
 
      05-04-2006
nm wrote:
> I create new prj w/ MSVC++ 6. This prj have compiler's option :
> Default struct alignment == 8 /Zp8
>
> so i don't know how do i declare myStruct w/ no alignment (align(1)).
>
> i declared
> __declspec(align(1)) struct tagMAB_CODE_HEADER{
> uint8 iID;
> uint8 iSection[8];
> uint16 iLength;
> uint8 iCmdID;
> uint8 iResponse;
> } ;
>
> typedef struct tagMAB_CODE_HEADER MAB_CODE_HEADER;
>
> but it's not work ?


Is that a question? Alignment is platform-specific and things like
'__declspec' are compiler-specific. As such they are OT here. Please
ask in 'microsoft.public.vc.language'.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
FAQ 7.8 How do I declare/create a structure? PerlFAQ Server Perl Misc 0 02-22-2011 11:00 PM
FAQ 7.8 How do I declare/create a structure? PerlFAQ Server Perl Misc 0 02-12-2011 05:00 PM
declare structure Rose Perl Misc 1 03-09-2008 09:09 AM
how to declare structure pointer in within a class sharat C++ 5 12-17-2006 12:46 PM
how to declare a structure and a class interlinked mosfet C++ 1 12-15-2003 10:45 AM



Advertisments