On Monday, May 21, 2012 1:20:28 PM UTC+3, ⚛ wrote:
Simplifying a little, C is the only widespread programming language where
you can explicitly specify the structure of data in memory. Most other
widespread languages (C#, Java, Haskell, Go, ...) lack this feature. This
statement may seem like an oversimplification, but it isn't far away from
the truth.
Simplifying a little, C is the only widespread programming language where
you can explicitly specify the structure of data in memory. Most other
widespread languages (C#, Java, Haskell, Go, ...) lack this feature. This
statement may seem like an oversimplification, but it isn't far away from
the truth.
specify the structure of data in memory. You must use non-standard #pragma
pack, and to really have it useable in headers, you must use #pragma
pack_push. I still remember this frustrating bug I've had with forgotten
#pragma pack in one of the nested headers...
C# on the other hand, offers a portable, and much nicer, way to set the
explicit memory layout of a struct:
http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.structlayoutattribute(v=vs.110).aspx
http://docs.go-mono.com/?link=T%3aSystem.Runtime.InteropServices.StructLayoutAttribute
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.