Advertisement

Using strings in C++

Started by June 23, 2000 01:03 AM
11 comments, last by Fender148 24 years, 5 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
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
Advertisement
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