more about programming style

Chris Gray cg at myriasb.UUCP
Tue Jul 23 03:49:54 AEST 1985


Perhaps I'm being a bit sarcastic, but could it be that the reason experienced
C programmers often use

	if ((fp = fopen("file", "r")) == NULL) ...

is that the compiler will complain if you write

	if ((fp = fopen("file", "r")) = NULL) ...

whereas it won't complain about

	fp = fopen("file", "r");
	if (fp = NULL) ...

???



More information about the Comp.lang.c mailing list