????? HELP!!! what is wring with this code? ???????

Marc Ries ries at jupiter
Sat Oct 8 00:36:21 AEST 1988


In article <456 at mrsvr.UUCP> ssa at mrsvr.UUCP (6607) writes:
>
>	For the life of me I can't figure out what is wrong with the following
>	code!!!!  It is supposed to parse words from a string in which words
[...]
>"test.c", line 7: warning: illegal combination of pointer and integer, op =
>	IT RUNS FINE !!!!!!!!
>#include <strings.h>
char *strtok();
>#define NULL (char *) 0
>main()
>{
>	char buf[81];
>	char *tokptr,*strptr=buf;
>	gets (buf);
>	while((tokptr=strtok(strptr," \t")) != NULL ){
[...]

   Even though it works, lint and the compiler will be happy if
   you tell it that you know that strtok() is going to return
   a character pointer ("char *strtok();"), not an int. 

Marc Ries
TRW Defense Systems Group/HMI
UUCP: {sdcrdcf,decvax,ucbvax}!trwrb!spp2!ries at trwspp.UUCP
Arpanet: ries at trwrb.TRW.COM



More information about the Comp.std.c mailing list