TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: MATHIEU BOUCHARD
from: JONATHAN DE BOYNE POLLARD
date: 1998-02-27 19:39:00
subject: converting char to string

 JdBP>> Or, idiomatically :
 JdBP>>         char ch ;
 JdBP>>         char str[2] = { ch } ;
 MB> does that guarantee that str[1] == 0 ?
Yes.  In an aggregate initialiser, missing initialisers for individual 
members of the aggregate imply zero initialisation.  As I said to Thomas, see 
sections 8.5 and 8.5.1 (especially paragraph 7) of the C++ Standard.
 ¯ JdeBP ®
--- FleetStreet 1.19 NR
---------------
* Origin: JdeBP's point, using Squish (2:440/4.3)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.