Path: utzoo!attcan!uunet!wuarchive!brutus.cs.uiuc.edu!apple!usc!cs.utexas.edu!rutgers!cmcl2!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: Is ``char c; strcpy(&c,"");'' ANSI C? Message-ID: <10817@smoke.BRL.MIL> Date: 24 Aug 89 21:02:51 GMT References: <30@looney.twinsun.com> Reply-To: gwyn@brl.arpa (Doug Gwyn) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 8 In article <30@looney.twinsun.com> eggert@twinsun.com (Paul Eggert) writes: > ... char c; strcpy(&c, ""); ... (1) >is not ANSI C, because strcpy calculates (&c) + 1, violating K&R A7.6, p.205, It's not a problem. The (proposed) C standard in effect guarantees that every object can be considered as an array of one thing, and that it is always legal to generate a pointer to the thing one past the last element of any array, although it is not legal to dereference such a pointer.