Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   C Programming (http://www.velocityreviews.com/forums/f42-c-programming.html)
-   -   if and for statements (http://www.velocityreviews.com/forums/t439669-if-and-for-statements.html)

Paminu 10-04-2005 07:45 PM

if and for statements
 
is this:
....
....
....
for (i = 0; i <16; i++)
{
if (arg & j) a++;
j <<= 2;
}

return (a & 1);
....
....
....

the same as:
for (i = 0; i <16; i++)
{
if (arg & j)
{
a++;
}

j <<= 2;

}

return (a & 1);


mario.demiguel@gmail.com 10-04-2005 07:55 PM

Re: if and for statements
 
Yes


Christopher Benson-Manica 10-04-2005 08:40 PM

Re: if and for statements
 
mario.demiguel@gmail.com wrote:

> Yes


It is proper Usenet etiquette to include the text you are replying to.
To do this using Google groups, please follow the instructions below,
penned by Keith Thompson:

If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers.

--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cyberspace.org | don't, I need to know. Flames welcome.

Default User 10-04-2005 08:41 PM

Re: if and for statements
 
mario.demiguel@gmail.com wrote:

> Yes


Yes, what?

--
Please quote enough of the previous message for context. To do so from
Google, click "show options" and use the Reply shown in the expanded
header.

Keith Thompson 10-04-2005 08:46 PM

Re: if and for statements
 
"Default User" <defaultuserbr@yahoo.com> writes:
> mario.demiguel@gmail.com wrote:
>
>> Yes

>
> Yes, what?


Yes, Sir?

--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.

Kenneth Brody 10-04-2005 11:11 PM

Re: if and for statements
 
Paminu wrote:
>
> is this:

[... code that differs only at ...]

> if (arg & j) a++;


[...and...]

> if (arg & j)
> {
> a++;
> }


[... the same? ...]

Yes.

--
+-------------------------+--------------------+-----------------------------+
| Kenneth J. Brody | www.hvcomputer.com | |
| kenbrody/at\spamcop.net | www.fptech.com | #include <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------------+
Don't e-mail me at: <mailto:ThisIsASpamTrap@gmail.com>


Barry Schwarz 10-05-2005 05:31 AM

Re: if and for statements
 
On Tue, 04 Oct 2005 21:45:44 +0200, Paminu <jadajada@asd.com> wrote:

>is this:
>...
>...
>...
>for (i = 0; i <16; i++)
>{
> if (arg & j) a++;
> j <<= 2;
>}
>
>return (a & 1);
>...
>...
>...
>
>the same as:
>for (i = 0; i <16; i++)
>{
> if (arg & j)
> {
> a++;
> }


Yes. If the "range" of the if is a single statement, the braces are
optional.

>
> j <<= 2;
>
>}
>
>return (a & 1);



<<Remove the del for email>>

Peter Shaggy Haywood 10-07-2005 05:22 AM

Re: if and for statements
 
Groovy hepcat Keith Thompson was jivin' on Tue, 04 Oct 2005 20:46:43
GMT in comp.lang.c.
Re: if and for statements's a cool scene! Dig it!

>"Default User" <defaultuserbr@yahoo.com> writes:
>> mario.demiguel@gmail.com wrote:
>>
>>> Yes

>>
>> Yes, what?

>
>Yes, Sir?


Yes, Sir, three bags full, Sir. :)

--

Dig the even newer still, yet more improved, sig!

http://alphalink.com.au/~phaywood/
"Ain't I'm a dog?" - Ronny Self, Ain't I'm a Dog, written by G. Sherry & W. Walker.
I know it's not "technically correct" English; but since when was rock & roll "technically correct"?

pete 10-07-2005 06:07 AM

[ot]Re: if and for statements
 
Peter Shaggy Haywood wrote:
>
> Groovy hepcat Keith Thompson was jivin' on Tue, 04 Oct 2005 20:46:43
> GMT in comp.lang.c.
> Re: if and for statements's a cool scene! Dig it!
>
> >"Default User" <defaultuserbr@yahoo.com> writes:
> >> mario.demiguel@gmail.com wrote:
> >>
> >>> Yes
> >>
> >> Yes, what?

> >
> >Yes, Sir?

>
> Yes, Sir, three bags full, Sir. :)


One for the little boy who lives down the drain.

"Lane" was not in my vocabulary when I learned this.

--
pete


All times are GMT. The time now is 04:48 AM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57