Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!mcvax!ukc!dcl-cs!stephen From: stephen@comp.lancs.ac.uk (Stephen J. Muir) Newsgroups: net.lang.c++ Subject: Declarations in statements -- a question. Message-ID: <372@comp.lancs.ac.uk> Date: Sat, 16-Aug-86 22:19:28 EDT Article-I.D.: comp.372 Posted: Sat Aug 16 22:19:28 1986 Date-Received: Wed, 20-Aug-86 08:29:39 EDT Reply-To: stephen@comp.lancs.ac.uk (Stephen J. Muir) Organization: Department of Computing at Lancaster University, UK. Lines: 20 Can anybody explain why the following fails to compile: main () { if (int i = 5) /* do something */; } when the following succeeds: main () { for (int i = 5; i; ) /* do something */; } C++ version 1.1, BSD 4.2, DEC VAX-11/750. -- EMAIL: stephen@comp.lancs.ac.uk | Post: University of Lancaster, UUCP: ...!mcvax!ukc!dcl-cs!stephen | Department of Computing, Phone: +44 524 65201 Ext. 4120 | Bailrigg, Lancaster, UK. Project:Alvey ECLIPSE Distribution | LA1 4YR