Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!mcnc!xanth!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!usc!cs.utexas.edu!uunet!mailrus!iuvax!bobmon From: bobmon@iuvax.cs.indiana.edu (RAMontante) Newsgroups: comp.sys.ibm.pc.programmer Subject: Re: `C' type question... Message-ID: <50258@iuvax.cs.indiana.edu> Date: 9 Jul 90 21:51:46 GMT Distribution: usa Organization: malkaryotic Lines: 16 weisen@eniac.seas.upenn.edu (Neil Weisenfeld) <26854@netnews.upenn.edu> : | Why does the following segment of code give a conversion between | integral types warning under MSC6.00? | | void strmem(char *mem, char *str, int n) | { | if (str && mem) | while (n--) | *mem++=(*str)?(*str++):ACTUAL_SPACE; | } K&R2 indicates that the conditional operator ( ? : ) expects a logical expression in the initial position, and logical expressions evaluate to integers. Try casting the (*str) to (int) type; that might silence it. Disclaimer: I haven't tried my TC, so I don't know what MSC actually does :-)