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


Groups > comp.lang.c > #2979

Re: Need some info on const char **

From Ike Naar <ike@iceland.freeshell.org>
Newsgroups comp.lang.c
Subject Re: Need some info on const char **
Date 2011-04-28 06:28 +0000
Organization A noiseless patient Spider
Message-ID <slrn3vfsiri28s.hn3.ike@iceland.freeshell.org> (permalink)
References <h3ler6dnl5jk821uhfvjvfcldgc8eqptel@4ax.com> <91p572Fu90U1@mid.uni-berlin.de> <7h5fr6p7g8pgdaeohia1dlumnl7tha9nlk@4ax.com> <91q0l9Fne0U1@mid.uni-berlin.de> <keahr61pvtnftn6vhtppsva2v51a3t7b0e@4ax.com>

Show all headers | View raw


On 2011-04-28, DSF <notavalid@address.here> wrote:
> On 27 Apr 2011 07:58:33 GMT, jt@toerring.de (Jens Thoms Toerring) wrote:
> {snipped}
>>So you make 'a' indirectly point to an (of course im-
>>mutable) string literal in foo() even though it's not
>>declared as a pointer to const char. And now there's
>>no protection anymore against changing what 'a' points
>>to in main(). But when you now try to modify it things
>>can go badly wrong. That should be excluded by using
>>
>>void foo( const char * const * p );
>>
>>since with that what 'p' points to also can't modified
>>in foo() (although my compiler still complains and I
>>haven't yet figured out why - or what what nasty things
>>I still could do in foo() ;-)
>
>   Mine is content and doesn't give a peep with:
>
> char *StringArrayToMultistring(const char * const *stringarray, char
> *multistring);
> ...
> char **s_array, ms[200];
> ...
> (Allocates and fills s_array)
> ...
> StringArrayToMultistring(s_array, ms);
>
>   To use a real world example.

Perhaps you are compiling your code as C++?

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


Thread

Need some info on const char ** DSF <notavalid@address.here> - 2011-04-26 18:49 -0500
  Re: Need some info on const char ** jt@toerring.de (Jens Thoms Toerring) - 2011-04-27 00:10 +0000
    Re: Need some info on const char ** DSF <notavalid@address.here> - 2011-04-27 00:38 -0500
      Re: Need some info on const char ** jt@toerring.de (Jens Thoms Toerring) - 2011-04-27 07:58 +0000
        Re: Need some info on const char ** Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-04-27 15:41 +0100
          Re: Need some info on const char ** lawrence.jones@siemens.com - 2011-04-27 14:42 -0400
        Re: Need some info on const char ** DSF <notavalid@address.here> - 2011-04-27 19:19 -0500
          Re: Need some info on const char ** Ike Naar <ike@iceland.freeshell.org> - 2011-04-28 06:28 +0000
            Re: Need some info on const char ** DSF <notavalid@address.here> - 2011-04-29 00:47 -0500
              Re: Need some info on const char ** Ike Naar <ike@sverige.freeshell.org> - 2011-04-29 09:13 +0000
                Re: Need some info on const char ** Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-04-29 16:08 +0100
                Re: Need some info on const char ** DSF <notavalid@address.here> - 2011-05-03 01:47 -0500
                Re: Need some info on const char ** Ike Naar <ike@otaku.freeshell.org> - 2011-05-03 07:45 +0000
                Re: Need some info on const char ** Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-05-03 11:55 +0100
                Re: Need some info on const char ** DSF <notavalid@address.here> - 2011-05-04 20:20 -0500
                Re: Need some info on const char ** Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-05-05 02:57 +0100
                Re: Need some info on const char ** DSF <notavalid@address.here> - 2011-05-07 22:03 -0500
                Re: Need some info on const char ** DSF <notavalid@address.here> - 2011-05-04 19:53 -0500
                Re: Need some info on const char ** falk@rahul.net (Edward A. Falk) - 2011-05-05 02:01 +0000
                Re: Need some info on const char ** Ike Naar <ike@sverige.freeshell.org> - 2011-05-05 05:51 +0000
                Re: Need some info on const char ** DSF <notavalid@address.here> - 2011-05-07 22:04 -0500
      Re: Need some info on const char ** Paul N <gw7rib@aol.com> - 2011-04-27 14:03 -0700

csiph-web