Gautam wrote:
Can any one tell me what are the types in C which are non portable/which make C
non-portable
is it
a)structures, or
b)unions, or
3)bit-fields, or
are all of them , i am confused
In its normal sense, portability is the ease with which you might
'port' a C program from one platform to another. The main purpose of
the C Standard is to define rules for compiler writers and
programmers so that this 'porting' of C programs more easily and
correctly.
There is nothing in the C Standard concerning the compatibility of
internal data structures or external file formats among platforms.
Nothing! You are on your own in this area.
Luckily we have ASCII (American Standard Code for Information
Interchange) text files common among most platforms. There is also
an ISO standard mirroring ASCII. EBCDIC (Extended Binary Coded
Decimal Interchange Code) is IBM's way of being one-up on ANSI in
the day. But I digress.
The various C implementations agree on what text representation of
values mean: '12345' a positive integer, '-23456' a negative one.
'1.25' is a floating point value. Virtually all C systems can read
these representations from a text file and come up with the same
internal values, endianness, width, etc. notwithstanding.
The text file is the answer. First, you can read it. If the
recipient of your data file doesn't already know its format, you can
explain it to her in the file itself and even include the C code to
interpret it.
Text rules! XML anyone?
--
Joe Wright mailto:jo********@comcast.net
"Everything should be made as simple as possible, but not simpler."
--- Albert Einstein ---