TIP: Click on subject to list as thread! ANSI
echo: aust_c_here
to: Paul Edwards
from: Roy McNeill
date: 1995-08-27 16:06:30
subject: Problem in C++

RM>   char c[6] = {"abcde"}; // note 1 char bigger to allow for \0



 PE> And why would you want to do that?



 Prolly the best reason is so that

strlen(c) will still make sense.



 PE> And even if you did want the

 PE> terminating NUL, why bother putting the "6" there?



Habit. Good point, though; easier and safer to let the compiler do

the work.



 PE> I forgot to

 PE> check for "void main" or stupid return values from main, so no

 PE> abuse this message!  :-)



Ooh ta. One day, when I clean it up, I'll send you my Sundial.cpp program

for your public domain collection, just to watch you turn funny

colours pulling it to bits 



Cheers



... 27/21



--- PPoint 1.88


* Origin: Silicon Heaven (3:711/934.16)
SEEN-BY: 711/809 934

SOURCE: echomail via fidonet.ozzmosis.com

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™.