Re:Interviewing programmers: coding test example explained
by tedunangst on Thursday June 03, 2010 @11:56AM
(#1401659)
The C standard exclusively uses the phrase "null-terminated" to refer to strings.
[ Parent
| on HN ]
Re:Interviewing programmers: coding test example explained
by cperciva on Thursday June 03, 2010 @03:15PM
(#1402208)
Huh, you're right. I wonder when they changed that.
Re:Interviewing programmers: coding test example explained
by nuxi on Thursday June 03, 2010 @04:18PM
(#1402403)
They didn't, it's there from at least ANSI C89 (ISO C90):
"A byte with all bits set to 0, called the null character, shall exist in the basic execution character set; it is used to terminate a character string literal."
Re:Interviewing programmers: coding test example explained
by JoachimSchipper on Thursday June 03, 2010 @06:12PM
(#1402777)
I think the rationale is in EBCDIC support; the C standard didn't want to/couldn't mandate ASCII, and therefore could not use the ASCII NUL character.
I honestly don't know whether POSIX/SUS mandates ASCII.
Re:Interviewing programmers: coding test example explained
by nuxi on Friday June 04, 2010 @07:48AM
(#1404032)
As far as I understand, no:
http://www.opengroup.org/onlinepubs/000095399/xrat/xbd_chap0...
Re:Interviewing programmers: coding test example explained
by JoachimSchipper on Friday June 04, 2010 @07:59AM
(#1404040)
I read that as "ASCII must be supported, do whatever else you want". But I don't want to spend too much time on this...