Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!swrinde!ucsd!ucsdhub!hp-sdd!ncr-sd!ncrcae!hubcap!kaires From: kaires@hubcap.clemson.edu (Robert G Kaires) Newsgroups: comp.lang.c Subject: Very elementary question concerning indirection Keywords: elementary question, indirection Message-ID: <7998@hubcap.clemson.edu> Date: 14 Feb 90 16:41:31 GMT Organization: Clemson University, Clemson, SC Lines: 25 Hello, I am just starting to learn C and I have what I'm sure is a very simple question. Consider the following program fragment: main() { char *pointer; char string[300]; gets(string); printf( "%c\n",*(strchr(string,40)) ); <---- line in question pointer = strchr(string,40); printf("%c\n",*pointer); } "partest.c", line 6: illegal indirection "partest.c", line 7: warning: illegal combination of pointer and integer, op = If the "line in question" is commented out, the program compiles with one warning on line 7 (This is in Vax Ultrex C, no warning is given in Turbo C). What is wrong with the "line in question". Also, what does this warning mean? Thanks for all replies! Bob Kaires