Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #70782

Re: Question on a C++ string

From T <T@invalid.invalid>
Newsgroups comp.lang.c++
Subject Re: Question on a C++ string
Date 2019-12-29 11:54 -0800
Organization A noiseless patient Spider
Message-ID <qub09p$5t1$4@dont-email.me> (permalink)
References <qu9hgc$nut$1@dont-email.me> <qu9uf6$ebq$1@dont-email.me> <cslh0fd7b39e9807s5sofj8lmqn12l56lv@4ax.com>

Show all headers | View raw


On 2019-12-29 08:45, Barry Schwarz wrote:
> On Sun, 29 Dec 2019 12:17:08 +0200, Paavo Helde
> <myfirstname@osa.pri.ee> wrote:
> 
>> In C, a string is commonly represented just as an array of characters.
>> The length of the array may be indicated by a terminating zero
>> character, or the length might be passed separately.
> 
> In order for the array to be a string, it must have a terminating
> zero.  Non-string arrays can use other termination characters or have
> the length specified separately but by definition they are not
> strings.
> 

Hi Barry,

I figured out through experimentation that Native Call
automatically adds the chr(0) on to the end of a CString.

And that sending Native Call a zero gets automatically
changed into a NULL.  Hmmm, I wonder what happens
if you really what a numerical zero.  That will be a
test for another day.

Trivia: I can stick all the chr(0) in a Raku/Perl6
string I want and in any position I want.  But
a Raku string is a "data structure", not an "array of
characters".  The end of the string is in the structure,
not the string itself.

Thank you all for all the wonderful help!

-T

Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Question on a C++ string T <T@invalid.invalid> - 2019-12-28 22:35 -0800
  Re: Question on a C++ string Jorgen Grahn <grahn+nntp@snipabacken.se> - 2019-12-29 09:33 +0000
    Re: Question on a C++ string Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2019-12-29 01:45 -0800
      Re: Question on a C++ string T <T@invalid.invalid> - 2019-12-29 01:49 -0800
        Re: Question on a C++ string Jorgen Grahn <grahn+nntp@snipabacken.se> - 2019-12-29 11:04 +0000
        Re: Question on a C++ string Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2019-12-29 13:57 -0800
          Re: Question on a C++ string T <T@invalid.invalid> - 2019-12-29 14:57 -0800
    Re: Question on a C++ string T <T@invalid.invalid> - 2019-12-29 01:50 -0800
      Re: Question on a C++ string Jorgen Grahn <grahn+nntp@snipabacken.se> - 2019-12-29 11:08 +0000
        Re: Question on a C++ string T <T@invalid.invalid> - 2019-12-29 11:50 -0800
          Re: Question on a C++ string Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2019-12-29 13:57 -0800
            Re: Question on a C++ string T <T@invalid.invalid> - 2019-12-29 15:00 -0800
      Re: Question on a C++ string Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2019-12-29 13:57 -0800
        Re: Question on a C++ string T <T@invalid.invalid> - 2019-12-29 15:02 -0800
          Re: Question on a C++ string Paavo Helde <myfirstname@osa.pri.ee> - 2019-12-30 01:28 +0200
      Re: Question on a C++ string Sam <sam@email-scan.com> - 2019-12-29 21:47 -0500
  Re: Question on a C++ string Bo Persson <bo@bo-persson.se> - 2019-12-29 11:00 +0100
    Re: Question on a C++ string T <T@invalid.invalid> - 2019-12-29 02:33 -0800
      Re: Question on a C++ string Bart <bc@freeuk.com> - 2019-12-29 12:09 +0000
        Re: Question on a C++ string T <T@invalid.invalid> - 2019-12-29 11:51 -0800
  Re: Question on a C++ string Paavo Helde <myfirstname@osa.pri.ee> - 2019-12-29 12:17 +0200
    Re: Question on a C++ string Barry Schwarz <schwarzb@delq.com> - 2019-12-29 08:45 -0800
      Re: Question on a C++ string T <T@invalid.invalid> - 2019-12-29 11:54 -0800
  Re: Question on a C++ string Öö Tiib <ootiib@hot.ee> - 2019-12-29 02:56 -0800
    Re: Question on a C++ string T <T@invalid.invalid> - 2019-12-29 12:02 -0800
  Re: Question on a C++ string Barry Schwarz <schwarzb@delq.com> - 2019-12-29 08:39 -0800
    Re: Question on a C++ string T <T@invalid.invalid> - 2019-12-29 12:10 -0800

csiph-web