By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,388 Members | 1,839 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,388 IT Pros & Developers. It's quick & easy.

how does pragma pack work?

P: n/a
I need to define a structure that is byte packed.
I was planning on using #pragma pack (1)

So when does the pragma pack end right after the first structure definition
or
at the end of the header file or until a new pragma pack is encountered...

This need to work for visual c++ as well as g++ (gnu cpp 3.3)
Jul 22 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
JustSomeGuy wrote:

I need to define a structure that is byte packed.
I was planning on using #pragma pack (1)

So when does the pragma pack end right after the first structure definition
or
at the end of the header file or until a new pragma pack is encountered...

This need to work for visual c++ as well as g++ (gnu cpp 3.3)


Check the g++ documentation to see what they do with this pragma. Check
the VC++ documentation to see what they do with this pragma. They might
be the same, but they might not. pragmas aren't standardized.

--

Pete Becker
Dinkumware, Ltd. (http://www.dinkumware.com)
Jul 22 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.