Path: utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!husc6!bu-cs!buengc!bph From: bph@buengc.BU.EDU (Blair P. Houghton) Newsgroups: comp.lang.c Subject: Re: Strange cc warning Message-ID: <2044@buengc.BU.EDU> Date: 4 Feb 89 16:39:06 GMT References: <490@marob.MASA.COM> <1709@cc.helsinki.fi> Reply-To: bph@buengc.bu.edu (Blair P. Houghton) Followup-To: comp.lang.c Organization: Boston Univ. Col. of Eng. Lines: 19 In article <1709@cc.helsinki.fi> teittinen@cc.helsinki.fi writes: >In article <490@marob.MASA.COM>, daveh@marob.MASA.COM (Dave Hammond) writes: >> *(out) = '"'; \ >This is wrong ---------------------------^^^ > >You may not use quote character (") in character variable. The part I've >marked should be '\"' and then you should not get any warnings. Not where I come from (i.e., p.181 of K&R, ed. 1). The only time a quote- within-a-quote should give you trouble is when nesting the quotation mark within a quotation of its own ilk: '\'' is the character constant for single-quotation mark; "\"" is the "string pointer" pointing to a double-quotation mark. Note that the converses-- '"' and "'" --require no backslash. --Blair ""'''\"'''" == *("\"'''\\\"'''\"")"