Re: [Dev-C++] help files and Operator Precedence
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Per W. <pw...@ia...> - 2004-12-11 14:28:07
|
Knowing thee precendence rules are part of basic programming skills. Anyway, there are _no_ precedence difference between auto and global variables when evaluating an expression. There is, of course, a difference in the time when the constructors/destructors will be run for variables declared global, auto or dyanmically allocated. /Wer W On Sun, 12 Dec 2004, Eric wrote: > Hi I belong to a micro-controller group, > > > someone in the group presented a formula (which might not be the problem to their question) > x = ((((mm-1)*31)+dd)-1)%8; > y = ((((mm-1)*31)+dd)-1)/8; > > > I told them it could be written as > x = ((mm-1)*31+dd-1)%8; > y = ((mm-1)*31+dd-1)/8; > > > if they look on the "Operator Precedence chart" > > it took me a while to remember I had printed off the Operator Precedence chart from the Borland help > files, for my own C++ notes (while I was at C++, school) > > While you can find the Operator Precedence chart on Internet with the help of Google, a couple of web > sites I have seen does not tell that most Operator Precedence level (16 in all) go from left to right, > but there are three that go from right to left, level 2, 13 and 15. > > > Hand written on the bottom of the page is a reminder local variables take precedence over global > variables (I was at school at the time when I wrote the notes, OK) > > > > The Aim of this posting is a suggestion this could included in the (dev-C++) help files on future > upgrades unless I am using a old version you can correct me and I would be grateful. > > > >From Eric Richards > > > > > > > > > --- > Outgoing mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.809 / Virus Database: 551 - Release Date: 09-Dec-04 > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://productguide.itmanagersjournal.com/ > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |