Using strings in C++

Started by
11 comments, last by Fender148 23 years, 9 months ago
quote:Original post by ImmaGNUman

C style strings are really arrays of ints (because of type promotion). Anyway, for c style string you should allocate space for a char pointer to a string.



< Magmai takes the bong away from ImmaGNUman, and bogarts it for himself>

Must be some good stuff too
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
Advertisement
quote:Original post by Rock2000

C strings are not arrays of ints. Type promotion applies to function parameters (and maybe a few other places), but definately not to arrays.

Rock


Unless, of course, we are talking about Unicode and wchar_t!

VK
Well, I''m sure we aren''t talking about wide characters, and type promotion wouldn''t apply there either, which was my main point. But if you want to be technical, they still aren''t arrays of ints. They are short ints.

Rock

This topic is closed to new replies.

Advertisement