NO

Author Topic: struct: int, double  (Read 8245 times)

andres1950

  • Guest
Re: struct: int, double
« Reply #15 on: May 26, 2011, 05:55:37 PM »
..and it seems, that it wheels while here is not padding...Pelles C supports this, other compilers not..

CommonTater

  • Guest
Re: struct: int, double
« Reply #16 on: May 26, 2011, 06:32:59 PM »
Andres... just an observation if I may...

In my experience people who start out as hobbiests often make the best craftsmen... for example, the guy who's building his own furniture is likely to become a far better cabinet maker.  Not because he has extra practice or knows some big secret... because he cares about the work. 

This also extends in to the programming craft... people who got into it because they actually enjoy programming (like you and I) very often make far better programmers than those who got into it for the money or fell into it with the family business (etc.)

The difference is that we chose this.  Since hobby programming (or knitting, for that matter) carries no time pressure and is, for us, it's own reward, the rewards are clearly bigger when we work hard at getting it right.

Enjoy the hobby my friend... I can think of no better passtime!

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2091
Re: struct: int, double
« Reply #17 on: May 26, 2011, 06:41:14 PM »
Test this packing if you want save it for general use.
Code: [Select]
#pragma pack(push,1)
struct test{
    char *name;
    double  age;
};
#pragma pack(pop)
May the source be with you