🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.sys.ibm.pc.programmer
1 messages
1 total messages Started by RAMontante Mon, 09 Jul 1990 21:51
Re: `C' type question...
#900
Author: RAMontante
Date: Mon, 09 Jul 1990 21:51
16 lines
1045 bytes
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 :-)
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads