Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!wuarchive!usc!ucsd!pacbell.com!ames!sgi!shinobu!odin!surfside!jindak From: jindak@surfside.sgi.com (Chris Schoeneman) Newsgroups: comp.lang.c Subject: Re: initialization Message-ID: <11221@odin.corp.sgi.com> Date: 1 Aug 90 17:19:25 GMT References: <1990Aug1.011654.22068@ccu.umanitoba.ca> Sender: news@odin.corp.sgi.com Organization: Silicon Graphics, Inc., Mountain View, CA Lines: 19 In article <1990Aug1.011654.22068@ccu.umanitoba.ca> rpjday@ccu.umanitoba.ca writes: >int func(int a) >{ > int i = a, j = i + 1 ; > >Am I allowed to initialize the integer "j" with the value of >another variable initialized in the same line? Of course you're allowed. C doesn't care if "i" is initialized or not! But don't worry, the comma operator is evaluated left to right. So your code will always work correctly (i.e. "a" will be assigned to "i", then "i"+1 will be assigned to "j"). Chris Schoeneman | I was neat, clean, shaved and sober, jindak@surfside.esd.sgi.com | and I didn't care who knew it. Silicon Graphics, Inc. | -Raymond Chandler Mountain View, CA | (The Big Sleep)