Path: utzoo!attcan!uunet!seismo!sundc!pitstop!sun!decwrl!labrea!rutgers!gatech!ncar!umigw!gables!slores%gables.span From: slores%gables.span@umigw.miami.edu (Stanislaw L. Olejniczak) Newsgroups: comp.lang.c Subject: down Message-ID: Date: 10 Dec 88 16:22:45 GMT Organization: University of Miami (IR) Lines: 16 PLEASE don't flame for posting too simple a question. I think the following SHOULD work, but will not even compile: while ( (c = getchar) != EOF) chcnt++ += (c == '\n'); The purpose is to count characters in a file. Each time a newline is encountered an additional character should be counted: when the file is transferred, a newline is CR-LF combination. A person I much respect for his C knowledge told me that this would be too complex for a compiler. I would appreciate if some other people would express their opinion if the statement is legal in C. chcnt is a long int, c is a char. Many thanks! ---- Stan Olejniczak Internet: slores%gables.span@umigw.miami.edu University of Miami UUCP: {uunet!gould}!umbio!solejni Miami, Florida, USA Voice: (305)-547-6005 My opinions cannot possibly represent the views of anyone else!