Uses of \"short\" ?

Arthur David Olson ado at elsie.UUCP
Sat Nov 16 03:52:12 AEST 1985


> . . .The main uses I have for type casts fall into a few categories:
>
>   (void) to discard the return value of a function. . .
>
>   Casting the returned value from malloc() (also the argument to free()). . .
> 
>   Forcing a short or an int to become a long. . .to avoid numeric overflow.
> 
>   Truncating a floating-point quantity to its integer part. . .
> 
>   Passing a NULL pointer argument to a function.
> 
>   Documenting a coercion that will occur anyhow. . .

Be sure to add:

    Casting the first argument to fread and fwrite.
--
C is a Jack Benny/Mel Blanc trademark.
--
	UUCP: ..decvax!seismo!elsie!ado    ARPA: elsie!ado at seismo.ARPA
	DEC, VAX and Elsie are Digital Equipment and Borden trademarks



More information about the Comp.lang.c mailing list