Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!feeder.erje.net!news-1.dfn.de!news.dfn.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Ian Collins Newsgroups: comp.lang.c Subject: Re: I need help Date: Mon, 16 May 2011 13:42:34 +1200 Lines: 15 Message-ID: <93bdoaFlpiU2@mid.individual.net> References: <45f62c12-a439-42b7-be27-bab7c954e209@glegroupsg2000goo.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net 21C1CXUmUrSngSk+77jknQ8tsHTvqZmWS0wBYiBpwW0EoLHBsR Cancel-Lock: sha1:X7LdYgAQfN+PyW7EvT0+Gtrl7PI= User-Agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:1.9.2.9) Gecko/20101021 Lightning/1.0b2 Thunderbird/3.1.4 In-Reply-To: Xref: x330-a1.tempe.blueboxinc.net comp.lang.c:4047 On 05/15/11 06:29 AM, Heinrich Wolf wrote: > > or with a macro: > > #define STRNCAT(a, b) strncat(a, b, sizeof(a) - strlen(a) - 1) > char string[10] = "NEW"; > STRNCAT(string, "Jersey"); That macro would go horribly (and silently) wrong if a) 'a' wasn't a fixed sized array, or b) it was, but the definition wasn't visible when the macro was expanded. -- Ian Collins