Strange cc warning

Blair P. Houghton bph at buengc.BU.EDU
Sun Feb 5 02:39:06 AEST 1989


In article <1709 at cc.helsinki.fi> teittinen at cc.helsinki.fi writes:
>In article <490 at marob.MASA.COM>, daveh at 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
				  ""'''\"'''" == *("\"'''\\\"'''\"")"



More information about the Comp.lang.c mailing list