U++ framework
Do not panic. Ask here before giving up.

Home » Community » Newbie corner » Writing Float big-endian on Windows
Re: Writing Float big-endian on Windows [message #31376 is a reply to message #31356] Sat, 26 February 2011 06:28 Go to previous messageGo to previous message
gprentice is currently offline  gprentice
Messages: 260
Registered: November 2005
Location: New Zealand
Experienced Member
If you care about portability you shouldn't assume that int is 32 bits or that float is 32 bits. They don't have to be the same size.

Also, I don't know why stream provides big endian and little endian functions instead of choosing automatically but assuming that float is big endian isn't exactly portable either. If you use Get and Put I wonder why would you care about how it's stored?

Graeme

[Updated on: Sat, 26 February 2011 06:29]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: TIme and Idle
Next Topic: Some code to add an icon in statusbar
Goto Forum:
  


Current Time: Sat Sep 26 04:31:58 GMT+2 2026

Total time taken to generate the page: 0.00716 seconds