[Home] [By Thread] [By Date] [Recent Entries]

  • To: "Rick Jelliffe" <ricko@a...>,<xml-dev@l...>
  • Subject: NULL in C (was RE: Why would MS want to make XML break on UNIX, Perl, Python, etc ?)
  • From: "Michael Rys" <mrys@m...>
  • Date: Fri, 21 Dec 2001 15:02:04 -0800
  • Thread-index: AcGJ/I2kPfLyv6jwSEuy0kdqdvoZdwAdeLBw
  • Thread-topic: NULL in C (was RE: Why would MS want to make XML break on UNIX, Perl, Python, etc ?)

This is going off-topic a bit, but two ways to represent 0C in C strings
are: 

- Do not use *char but operate on the byte level. Since C let's you work
on a string even if it contains 0C (although not with the standard
string libraries, functions and operations), you could return a struct
that gives the length and the memory area.

Thus 'a0Cb0C0Cd' would become (6, 'a0Cb0C0Cd')

- Use an array of strings where every 0C will move to the next item and
give length of array. You will need a sentinel at the end for the last
0C. 

Thus 'a0Cb0C0Cd' would become (4, 'a0C', 'b0C', '0C, 'd0C')

So it is doable, but not easy...

Best regards
Michael


Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member