Path: utzoo!utgpu!watmath!clyde!att!whuts!homxb!hound!rkl1 From: rkl1@hound.UUCP (K.LAUX) Newsgroups: comp.lang.c Subject: Re: function prototype problem Summary: memset Message-ID: <2746@hound.UUCP> Date: 15 Nov 88 17:06:55 GMT References: <310@drd.UUCP> Distribution: na Organization: AT&T Bell Laboratories, Holmdel Lines: 38 In article <310@drd.UUCP>, mark@drd.UUCP (Mark Lawrence) writes: | I compile the following code fragment: | -- | #include | | char *rpeet ( short, char ); | char rpeet_temp[81]; | | char *rpeet ( num, ch ) | short num; | char ch; | { | int i; | | memset( rpeet_temp, ch, num ); ^^ ^^^ <--***NOTE*** | rpeet_temp[num] = '\0'; | return( rpeet_temp ); | } | -- | and get the following gripe from my compiler (gcc 1.30): | | rpeet.c: In function rpeet: | rpeet.c:9: argument `num' doesn't match function prototype | rpeet.c:9: argument `ch' doesn't match function prototype | I don't think the compiler is complaining at all about the function prototype for rpeet; it's complaining about the call to MEMSET. The function prototype for memset () is: void *memset (void *dest, int c, size_t count); ^^^ ^^^^^^ and neither 'num' nor 'ch' is of the proper type. --rkl