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
>
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
> > 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
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
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
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
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.
-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
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
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
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
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
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,
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 '
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
; 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
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
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
>
>
>
> 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/
> 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
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
> 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;
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
23 matches
Mail list logo