Re: offtopic: who can figure out this for loop

2003-06-25 Thread Paul Johnson
n" <[EMAIL PROTECTED]> To: "Palm Developer Forum" <[EMAIL PROTECTED]> Sent: Wednesday, June 25, 2003 8:51 PM Subject: Re: offtopic: who can figure out this for loop > 1. The ++x won't get compiled either :) > > > Regards, > Paul Johnson >

Re: offtopic: who can figure out this for loop

2003-06-25 Thread Paul Johnson
1. The ++x won't get compiled either :) Regards, Paul Johnson Applewood House www.applewoodhouse.com - Original Message - From: "Aaron Ardiri" <[EMAIL PROTECTED]> To: "Palm Developer Forum" <[EMAIL PROTECTED]> Sent: Tuesday, June 24, 2003 8:18 PM

Re: offtopic: who can figure out this for loop

2003-06-24 Thread Philip Sheard
> > int x = 1; > > for( int i = 0; i < 100; ++i ); > > // What will the next line do? Increment???/ > > ++x; > > on a standards conforming c++ compiler the ++x; line should be considered as a > comment because the previous line ends with a slash ( indicating that the > next line

RE: offtopic: who can figure out this for loop

2003-06-24 Thread Sebastian Voges
On Tue, 24 Jun 2003 15:43:17 -0500, Ben Combee wrote: > > >>I guess depending on the compiler it interprets '??/' as a'\' >>from: >>http://www.gotw.ca/gotw/086.htm > > CW will only interpret trigraphs if you turn on the "Expand Trigraphs" > option in the C/C++ Language panel. The value of

RE: offtopic: who can figure out this for loop

2003-06-24 Thread Ben Combee
I guess depending on the compiler it interprets '??/' as a'\' from: http://www.gotw.ca/gotw/086.htm CW will only interpret trigraphs if you turn on the "Expand Trigraphs" option in the C/C++ Language panel. The value of that switch would change the meaning of this code. -- Ben Combee <[EMAI

RE: offtopic: who can figure out this for loop

2003-06-24 Thread Brian Smith
On Tue, 24 Jun 2003, Sebastian Voges wrote: > I guess depending on the compiler it interprets '??/' as a'\' from: > http://www.gotw.ca/gotw/086.htm Depending on the compiler, it may also depend on a compiler switch. camelot:~> g++ test.c camelot:~> ./a.out 2 camelot:~> g++ test.c -trigraphs came

Re: offtopic: who can figure out this for loop

2003-06-24 Thread Paul Jewell
On Tuesday 24 June 2003 9:14 pm, you wrote: > At 3:57 PM -0400 6/24/03, Sebastian Voges wrote: > >On Tue, 24 Jun 2003 15:44:38 -0400, Kevin OKeefe wrote: > >> this slash '\' is continuation not '/'... > > > >I guess depending on the compiler it interprets '??/' as a'\' > >from: http://www.gotw.

RE: offtopic: who can figure out this for loop

2003-06-24 Thread David A. Desrosiers
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 > IANALL, but... And before anybody asks, "I Am Not A Language Lawyer".. d. perldoc -qa.j | perl -lpe '($_)=m("(.*)")' -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.2 (GNU/Linux) iD8DBQE++LNRkRQERnB1rkoRAqLcAKCQI9zx2vXoGLvIhwoOcaE7l

RE: offtopic: who can figure out this for loop

2003-06-24 Thread Keith Rollin
At 3:57 PM -0400 6/24/03, Sebastian Voges wrote: On Tue, 24 Jun 2003 15:44:38 -0400, Kevin OKeefe wrote: this slash '\' is continuation not '/'... I guess depending on the compiler it interprets '??/' as a'\' from: http://www.gotw.ca/gotw/086.htm IANALL, but... Both trigraph replacement and

Re: offtopic: who can figure out this for loop

2003-06-24 Thread Paul Jewell
On Tuesday 24 June 2003 8:57 pm, you wrote: > Sometimes I really worry about this group... ;-) Page 229 of K&R 2nd edition (1988) gives a total of 9 trigraph sequences, so those among you who want to dream up some more devilish code should dive in there! Rgds., Paul -- For information on usin

RE: offtopic: who can figure out this for loop

2003-06-24 Thread Mark Cameron
Sometimes I really worry about this group... ;-) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Craig Austin Sent: Tuesday, June 24, 2003 12:56 PM To: Palm Developer Forum Subject: RE: offtopic: who can figure out this for loop Sebastian is actually

RE: offtopic: who can figure out this for loop

2003-06-24 Thread Sebastian Voges
On Tue, 24 Jun 2003 15:44:38 -0400, Kevin OKeefe wrote: > > this slash '\' is continuation not '/'... > I guess depending on the compiler it interprets '??/' as a'\' from: http://www.gotw.ca/gotw/086.htm T Nikolai Smirnov writes: "Probably, what's happened in the program is obvious for yo

RE: offtopic: who can figure out this for loop

2003-06-24 Thread Craig Austin
PM > To: Palm Developer Forum > Subject: RE: offtopic: who can figure out this for loop > > > that would have been a trick question and the answer is as you > expected when you use the correct slash... > > -Original Message- > From: Kevin OKeefe > Sent: Tuesday,

RE: offtopic: who can figure out this for loop

2003-06-24 Thread Kevin OKeefe
that would have been a trick question and the answer is as you expected when you use the correct slash... -Original Message- From: Kevin OKeefe Sent: Tuesday, June 24, 2003 12:45 PM To: Palm Developer Forum Subject: RE: offtopic: who can figure out this for loop this slash '

RE: offtopic: who can figure out this for loop

2003-06-24 Thread Kevin OKeefe
this slash '\' is continuation not '/'... -Original Message- From: Sebastian Voges [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 24, 2003 12:43 PM To: Palm Developer Forum Subject: RE: offtopic: who can figure out this for loop Hi Kevin, Aaron, allright i did n

RE: offtopic: who can figure out this for loop

2003-06-24 Thread Sebastian Voges
; Sent: Tuesday, June 24, 2003 12:30 PM > To: Palm Developer Forum > Subject: RE: offtopic: who can figure out this for loop > > > >> >> 2 >> > close :-)) > Look at the code carefully. Did I mention it is a trick question? -- For informat

RE: offtopic: who can figure out this for loop

2003-06-24 Thread Kevin OKeefe
The semi at the end of the for loop makes it an empty loop, the formatting of the ++x is irrelevant, the answer is 2. -Original Message- From: Sebastian Voges [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 24, 2003 12:30 PM To: Palm Developer Forum Subject: RE: offtopic: who can figure

RE: offtopic: who can figure out this for loop

2003-06-24 Thread Kevin OKeefe
I copied these lines into codewarrior, turned on c++ and ran it and it's 2. -Original Message- From: Sebastian Voges [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 24, 2003 12:30 PM To: Palm Developer Forum Subject: RE: offtopic: who can figure out this for loop > >

RE: offtopic: who can figure out this for loop

2003-06-24 Thread Sebastian Voges
> > 2 > close :-)) Look at the code carefully. Did I mention it is a trick question? -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/

Re: offtopic: who can figure out this for loop

2003-06-24 Thread Sebastian Voges
> 2. > > why? > >> for( int i = 0; i < 100; ++i ); <-- see that ';' > > the compiler interprets this code as: > > int x = 1; > for (int i=0; i<100; i++) > { > } > ++x; > > basic C :) > nice try Aaron, unfortunately not correct :-p Still looking for the correct answer :-)) -- For in

RE: offtopic: who can figure out this for loop

2003-06-24 Thread Kevin OKeefe
2 -Original Message- From: Sebastian Voges [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 24, 2003 12:16 PM To: Palm Developer Forum Subject: offtopic: who can figure out this for loop Not really PalmOS related, but hey you can run it on your Handheld: int x = 1; for( int i = 0; i

Re: offtopic: who can figure out this for loop

2003-06-24 Thread Aaron Ardiri
> Not really PalmOS related, but hey you can run it on your Handheld: > > int x = 1; > for( int i = 0; i < 100; ++i ); > // What will the next line do? Increment???/ > ++x; > > what's the value of x after this code ran on a standard c++ compiler? 2. why? > for( int i = 0;

offtopic: who can figure out this for loop

2003-06-24 Thread Sebastian Voges
Not really PalmOS related, but hey you can run it on your Handheld: int x = 1; for( int i = 0; i < 100; ++i ); // What will the next line do? Increment???/ ++x; what's the value of x after this code ran on a standard c++ compiler? Sebastian -- For information on using