 |
 |
|
 |
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Christoph Hormann <chr### [at] gmx de> wrote:
> '\0' indicates the end of a string so this would mess up the whole thing.
This shouldn't be a problem in C++. C++ strings do not have any special
character which marks the end of the string (ie. strings can have any
characters).
--
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On 8 May 2003 13:52:47 -0400, Warp <war### [at] tag povray org> wrote:
> Christoph Hormann <chr### [at] gmx de> wrote:
> > '\0' indicates the end of a string so this would mess up the whole thing.
>
> This shouldn't be a problem in C++. C++ strings do not have any special
> character which marks the end of the string (ie. strings can have any
> characters).
IIRC Hugo meant _small_ change in POV-Ray sources ;-)
ABX
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
> IIRC Hugo meant _small_ change in POV-Ray sources ;-)
I do have a few questions to this:
Would a text file ever contain a null character (ascii value zero)
considering it's only text? A text file uses 0-9, A-Z, a-z, a few !"#&
signs, an invisible line break, and EOF.. There seems to be no need for a
null character.
On the other hand, if we are actually talking about 2 characters '\0' then
why not convert them to an ascii value that is never used in a text file?
Just as long as the C string can hold it. Then convert it back to \0 when
the user wants to read the string.
Regards,
Hugo
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
In article <3ebac760@news.povray.org>, "Hugo Asm" <hua### [at] post3 tele dk>
wrote:
> Would a text file ever contain a null character (ascii value zero)
> considering it's only text? A text file uses 0-9, A-Z, a-z, a few !"#&
> signs, an invisible line break, and EOF.. There seems to be no need for a
> null character.
Probably not, but this restriction makes binary files unuseable.
--
Christopher James Huff <cja### [at] earthlink net>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tag povray org
http://tag.povray.org/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
In article <3EBA5031.EDABF9C2@gmx.de>,
Christoph Hormann <chr### [at] gmx de> wrote:
> No, i think he means if the file contains a '\0' this will result in a
> '\0' :-)
>
> '\0' indicates the end of a string so this would mess up the whole thing.
Only on null-terminated strings. If you store the length separately, you
don't need a null terminator and can have any byte value in the string.
--
Christopher James Huff <cja### [at] earthlink net>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tag povray org
http://tag.povray.org/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |