TIP: Click on subject to list as thread! ANSI
echo: c_echo
to: KURT KUZBA
from: MARK TRICKETT
date: 1998-01-07 11:37:00
subject: Menu Function

 -=> Quoting Kurt Kuzba to Jack Stein <=-
 JS>   If I have a char array, char string[3] = "123" then say
 JS>   string[3]=(char)'\0', I then have a string.  I'm not sure
 JS>   why you typed cast the '\0' though, perhaps that was the point?
 KK> string[3] is already == '\0' in that case, since it is a
 KK> string literal embedded in your code. A char is an integer,
 KK> and some compilers will complain if you put an integer into
 KK> a char array, hence the cast to (char).
  Hello Kurt, looking at the prior fragment under discussion,
  char string[3] = "123" has no room for a trailing null. string[0]
  contains 1, string[1] contains 2, and string[2] contains 3 while
  string[3] is beyond the originally allocated dimensions of the
  array.
  Regards,     Mark Trickett
--- Blue Wave/DOS v2.30
---------------
* Origin: Micom's Maximus CBCS (03) 9752-3949 (3:633/371)

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