Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!sppy00!dwb From: dwb@sppy00.UUCP (David Burhans) Newsgroups: comp.lang.c Subject: Re: This one bit me today Message-ID: <568@sppy00.UUCP> Date: 5 Oct 89 15:07:38 GMT References: <2432@hub.UUCP> Reply-To: dwb@sppy00.UUCP (David Burhans) Organization: Online Computer Library Center, Dublin, Ohio. Lines: 27 In article <2432@hub.UUCP> dougp@voodoo.ucsb.edu writes: 1> main() 2> { 3> int a=1,b=2,*p=&a,c; 4> c=b/*p; 5> } > > First real flaw in the C grammer I have found. This is not a flaw in the C grammer, it is a flaw in the c programmer. Don't expect a compiler to second guess you. Line 4 contains an assignment and the start of a comment. As there is no end of comment, you should get an error message along the lines of ``unterminated comment.'' Try the following: c = b / *p; White space not only solves your problem, it makes your code more readable. Also, in line 3 you have an illegal compination of an int * and an int. Once again, white space solves your problem. -DwB -- dwb@sppy00 {att|killer|pyramid}!osu-cis!sppy00!dwb David Burhans/6565 Frantz Rd./Columbus, Oh 43017 **** Views expressed above were randomly generated with a six sided die and as such are not the views of my employer. *****