Path: utzoo!attcan!uunet!lll-winken!lll-lcc!ncis.llnl.gov!ncis!helios.ee.lbl.gov!pasteur!agate!bionet!csd4.milw.wisc.edu!leah!rds95 From: rds95@leah.Albany.Edu (Robert Seals) Newsgroups: comp.lang.c Subject: Use of " ? : " in format param to printf Keywords: printf Message-ID: <1454@leah.Albany.Edu> Date: 19 Jan 89 17:17:19 GMT Organization: The University at Albany, Computer Services Center Lines: 21 I have a question. main() { double sum; int count; /* ..... */ printf(count == 0 ? " ---- " : " %4.0lf ", sum / count); } (If something is dopey, just ignore it because the main thing is...) Does it matter if there are unused arguments to printf? That is, if 'count' is zero, will anything be screwed up because there is extra crud in the code? The actual application I'm doing is much more complicated than this (REALLY??), but the principal is the same. Is this OK code? Lint didn't mind, nor did gcc -Wall. rob