Xref: utzoo comp.lang.c:13117 comp.std.c:406 comp.lang.scheme.c:14 comp.unix.questions:9597 Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!uwmcsd1!mrsvr!ssa From: ssa@mrsvr.UUCP (6607) Newsgroups: comp.lang.c,comp.std.c,comp.lang.scheme.c,comp.unix.questions Subject: ????? HELP!!! what is wring with this code? ??????? Message-ID: <456@mrsvr.UUCP> Date: 6 Oct 88 23:00:59 GMT Organization: GE Medical, MR Center, Milwaukee Lines: 44 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 are delimited by blanks or tabs, and print one word a line. Simple right? well not quite. when I compile it I get a message: "test.c", line 7: warning: illegal combination of pointer and integer, op = this of course referes to the line with the while loop. When I run it the prompt just comes back, (I am not prompted to put in my string) and the funny part is when I run the same program in dbxtool (SUN WS) IT RUNS FINE !!!!!!!! ____________________________________________________________________________ #include #define NULL (char *) 0 main() { char buf[81]; char *tokptr,*strptr=buf; gets (buf); while((tokptr=strtok(strptr," \t")) != NULL ){ printf ("%s\n",tokptr); strptr=NULL; } } ---------------------------------------------------------------------------- So, what is wrong??? Thanks in advance... ======================================================================= / /| | |\ \ | | /__ /_| | |_\ \ | | ...att!uwmcsd1!mrsvr!ssa / / | | | \ \ | | (414) 547-9429 / o / | |__ | \ \| | (414) 521-6607 (work) =======================================================================