rday (01/03/83)
A common use of the void type is to use it as a cast for functions which normally return values, but you wish to ignore: strcpy(str1,str2) will cause lint to respond that strcpy always returns which is ignored, but (void) strcpy(str1,str2) keeps lint happy. In either case, normal cc compiling will work correctly.
rday (01/03/83)
My previous article should say ".. that strcpy always returns a value, ..." That's what I get for using postnews instead of inews.
rjk (01/06/83)
Not only is void used in casting, it can be used (and IS used in USG 5.0 & System V) as function type declarations. An example of such would be the declaration of a function which is called as the second argument to signal: void catchit(){ ++delcnt; } main() { . . signal(SIG_INT, catchit); . . Randy King ..we13!rjk