Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » unexpected output while reading the size of structure.
Re: unexpected output while reading the size of structure. [message #34771 is a reply to message #34755] Mon, 12 December 2011 09:41 Go to previous message
cbpporter is currently offline  cbpporter
Messages: 1428
Registered: September 2007
Ultimate Contributor
The size of 16 is correct. There are very good technical reasons for it to be so and Novo pointed out some links. Unless you have very good reasons to use an unaligned/packed struct, I would recommend against it.

One thing that you could try is reorder the elements. There is this old trick of ordering elements, with the largest/more alignment constrained ones first. So put the double first, then the int, then the char.

If you are using binary storage an rely on fixed size (like 13) the solution is to read/write each field separately.
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: dli file for Oracle10g
Next Topic: gdk_pixbuf-2.0 linker error
Goto Forum:
  


Current Time: Sun Aug 03 09:17:47 CEST 2025

Total time taken to generate the page: 0.07045 seconds