Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c++ > #85654
| From | Juha Nieminen <nospam@thanks.invalid> |
|---|---|
| Newsgroups | comp.lang.c++ |
| Subject | Re: Is a char array initializer a "string literal"? |
| Date | 2022-07-26 10:19 +0000 |
| Organization | Aioe.org NNTP Server |
| Message-ID | <tbof2i$4ld$1@gioia.aioe.org> (permalink) |
| References | <tbo6pa$cdd$1@gioia.aioe.org> <1e68e656-89b6-42c1-a9e5-3d52387a5255n@googlegroups.com> |
Malcolm McLean <malcolm.arthur.mclean@gmail.com> wrote: > C doesn't really have strings. It just has char arrays. Whilst strings are pretty > much always implemented as char arrays in any language, in most languages > you have a "string type", and you can copy, assign, concatenate and so on > with inbuilt language features. C doesn't do this. > The exception is that string literals (double quoted text in source code) are > allowed as special syntax for creating a string. That's not really relevant to what I was asking. Besides, the C standard calls then "strings" throughout. For example, it says that the 'argv' value that the main() function gets is an array of pointers to strings. On a particular curious note, in another part it says: "A character string literal need not be a string (see 7.1.1), because a null character may be embedded in it by a \0 escape sequence." 7.1.1 defines: "A string is a contiguous sequence of characters terminated by and including the first null character."
Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Is a char array initializer a "string literal"? Juha Nieminen <nospam@thanks.invalid> - 2022-07-26 07:57 +0000
Re: Is a char array initializer a "string literal"? Muttley@dastardlyhq.com - 2022-07-26 08:03 +0000
Re: Is a char array initializer a "string literal"? Öö Tiib <ootiib@hot.ee> - 2022-07-26 01:51 -0700
Re: Is a char array initializer a "string literal"? Juha Nieminen <nospam@thanks.invalid> - 2022-07-26 10:07 +0000
Re: Is a char array initializer a "string literal"? Öö Tiib <ootiib@hot.ee> - 2022-07-26 05:10 -0700
Re: Is a char array initializer a "string literal"? Öö Tiib <ootiib@hot.ee> - 2022-07-26 06:18 -0700
Re: Is a char array initializer a "string literal"? Juha Nieminen <nospam@thanks.invalid> - 2022-07-26 16:03 +0000
Re: Is a char array initializer a "string literal"? "Alf P. Steinbach" <alf.p.steinbach@gmail.com> - 2022-07-26 18:18 +0200
Re: Is a char array initializer a "string literal"? Juha Nieminen <nospam@thanks.invalid> - 2022-07-27 07:40 +0000
Re: Is a char array initializer a "string literal"? Öö Tiib <ootiib@hot.ee> - 2022-07-27 01:17 -0700
Re: Is a char array initializer a "string literal"? Bo Persson <bo@bo-persson.se> - 2022-07-26 11:11 +0200
Re: Is a char array initializer a "string literal"? Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2022-07-26 02:30 -0700
Re: Is a char array initializer a "string literal"? Juha Nieminen <nospam@thanks.invalid> - 2022-07-26 10:19 +0000
Re: Is a char array initializer a "string literal"? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2022-07-26 12:03 -0700
Re: Is a char array initializer a "string literal"? Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2022-07-27 01:56 -0700
Re: Is a char array initializer a "string literal"? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2022-07-27 11:02 -0700
Re: Is a char array initializer a "string literal"? "Alf P. Steinbach" <alf.p.steinbach@gmail.com> - 2022-07-26 11:36 +0200
Re: Is a char array initializer a "string literal"? Juha Nieminen <nospam@thanks.invalid> - 2022-07-26 10:22 +0000
Re: Is a char array initializer a "string literal"? "Alf P. Steinbach" <alf.p.steinbach@gmail.com> - 2022-07-26 16:50 +0200
Re: Is a char array initializer a "string literal"? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2022-07-26 12:13 -0700
Re: Is a char array initializer a "string literal"? Andrey Tarasevich <andreytarasevich@hotmail.com> - 2022-07-26 17:56 -0700
Re: Is a char array initializer a "string literal"? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2022-07-26 19:24 -0700
Re: Is a char array initializer a "string literal"? Andrey Tarasevich <andreytarasevich@hotmail.com> - 2022-07-27 13:05 -0700
Re: Is a char array initializer a "string literal"? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2022-07-27 15:38 -0700
csiph-web