Topic: Malloc strangeness!
Author: Bill Seymour <bsey@pobox.com>
Date: 1999/01/20 Raw View
luca78 wrote:
>
> ... neither ANSI C nor ANSI C++
> standards state that a char is one byte long, even if it is true in most
> implementations; it's much better to write
>
> malloc(len*sizeof(char))
>
No, sizeof(char) is always one by definition.
--Bill Seymour
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]