Amit Dang wrote: > Thanks for the reply. So any idea about how structure should be defined > in case it is to be used by a text file editor which works on both linux & > solaris.
However you like. You shouldn't be trying to read blocks of data from a file directly into a C "struct" in memory. That technique is fine for "internal" files which only need to be read by one version of the software on one particular platform, but it's the wrong approach for "interchange" files which can be transferred between different systems or different versions of the software. For interchange formats, rather than making assumptions about the size, offset and byte order of structure fields, you should either write your own decoding and encoding routines or use a standard data encoding (e.g. XDR, ASN.1 etc). -- Glynn Clements <[EMAIL PROTECTED]> - To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
