Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

PowerPad

Microsoft Visual C++ 6.0 an Error or what the....

This topic is 6175 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I defined a structure with like the fallowing one struct myStruct { short int a; int b; short int c; short int d; int e; }; This structure is 14Bytes long, i then tried the fallowing code void main(void) { printf("sizeof(myStruct) = %d\r\n", sizeof(myStruct)); } and the program returned 16Bytes. The compiler i use is MSVC++ 6.0 publishers edition (this version shipped with the game developing starter kit) under Win98 (PIII 450, 196MB, DirectX 8, Geforce 256) does someone know anything about this problem our stuff related to this

Share this post


Link to post
Share on other sites
Advertisement
Right, to turn this off, go to project menu, settings, c/c++ tab, bring down code generation and change your struct member alignment. Mine seems to align on 8 byte bounries on default.


Mike

Share this post


Link to post
Share on other sites
Or:

#pragma pack(push,1)

struct
{
jada jada
};

#pragma pack(pop) // back to the old size

/McFly

Edited by - mcfly on September 21, 2001 9:58:12 PM

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!