Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > for( int i1=0,i2=0 ; i1<n1 && i2<n2; i1+=2, i2+=4)

Reply
Thread Tools

for( int i1=0,i2=0 ; i1<n1 && i2<n2; i1+=2, i2+=4)

 
 
hokus
Guest
Posts: n/a
 
      09-28-2005
Jak zapisać pętlę for, aby po każdej iteracji zmienna i1 zwiększała się o 2,
a i2 o 4.

Dzięki

 
Reply With Quote
 
 
 
 
hokus
Guest
Posts: n/a
 
      09-28-2005
In english, how to write for loop to change i1 and i2 after each iterations?

Thanks
 
Reply With Quote
 
 
 
 
Emmanuel Delahaye
Guest
Posts: n/a
 
      09-28-2005
hokus wrote on 28/09/05 :
> Jak zapisać pętlę for, aby po każdej iteracji zmienna i1 zwiększała się o 2,
> a i2 o 4.
>
> Dzięki


My Polish is rusty. Please try newsl.comp.lang.c

Thanks.


--
Emmanuel
The C-FAQ: http://www.eskimo.com/~scs/C-faq/faq.html
The C-library: http://www.dinkumware.com/refxc.html

"It's specified. But anyone who writes code like that should be
transmogrified into earthworms and fed to ducks." -- Chris Dollin CLC


 
Reply With Quote
 
Emmanuel Delahaye
Guest
Posts: n/a
 
      09-28-2005
hokus wrote on 28/09/05 :
> In english, how to write for loop to change i1 and i2 after each iterations?
>
> Thanks


Please place your code in the body. I can't read the subject line (too
small characters).

--
Emmanuel
The C-FAQ: http://www.eskimo.com/~scs/C-faq/faq.html
The C-library: http://www.dinkumware.com/refxc.html

"Mal nommer les choses c'est ajouter du malheur au
monde." -- Albert Camus.


 
Reply With Quote
 
Kenneth Brody
Guest
Posts: n/a
 
      09-28-2005
hokus wrote:
>
> In english, how to write for loop to change i1 and i2 after each iterations?
>
> Thanks


(Sorry, I don't speak Polish, and Babelfish doesn't have Polish, either.)

Exactly as you have in your subject line. Place multiple comma-separated
items as the third part of the "for" statement.

However, you can't put "int i1=0,i2=0" within the for statement (though
this may be allowed in C99):

int i1, i2;
for ( i1=0, i2=0 ; i1<n1 && i2<n2 ; i1 += 2, i2 += 4 )
{
...
}

--
+-------------------------+--------------------+-----------------------------+
| Kenneth J. Brody | www.hvcomputer.com | |
| kenbrody/at\spamcop.net | www.fptech.com | #include <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------------+
Don't e-mail me at: <(E-Mail Removed)>

 
Reply With Quote
 
Bruintje Beer
Guest
Posts: n/a
 
      10-01-2005

"hokus" <(E-Mail Removed)> schreef in bericht
news:dhemi4$8ql$(E-Mail Removed)...
> Jak zapisać pętlę for, aby po każdej iteracji zmienna i1 zwiększała się o
> 2, a i2 o 4.
>
> Dzięki


sounds like you have drunk too much vodka

John


 
Reply With Quote
 
Emmanuel Delahaye
Guest
Posts: n/a
 
      10-01-2005
Bruintje Beer wrote on 01/10/05 :
> "hokus" <(E-Mail Removed)> schreef in bericht
> news:dhemi4$8ql$(E-Mail Removed)...
>> Jak zapisać pętlę for, aby po każdej iteracji zmienna i1 zwiększała się o
>> 2, a i2 o 4.
>>
>> Dzięki

>
> sounds like you have drunk too much vodka


There is a name for that: 'préjugé' or worst, 'racism'. In my country,
it's a crime.

--
Emmanuel
The C-FAQ: http://www.eskimo.com/~scs/C-faq/faq.html
The C-library: http://www.dinkumware.com/refxc.html

I once asked an expert COBOL programmer, how to
declare local variables in COBOL, the reply was:
"what is a local variable?"


 
Reply With Quote
 
Mark McIntyre
Guest
Posts: n/a
 
      10-01-2005
On Sat, 01 Oct 2005 16:44:59 +0200, in comp.lang.c , "Emmanuel
Delahaye" <(E-Mail Removed)> wrote:

>Bruintje Beer wrote on 01/10/05 :
>> "hokus" <(E-Mail Removed)> schreef in bericht
>> news:dhemi4$8ql$(E-Mail Removed)...
>>> Jak zapisać pętlę for, aby po każdej iteracji zmienna i1 zwiększała się o
>>> 2, a i2 o 4.
>>>
>>> Dzięki

>>
>> sounds like you have drunk too much vodka

>
>There is a name for that: 'préjugé' or worst, 'racism'. In my country,
>it's a crime.


I imagine it was meant to be a joke.

Certainly I don't regard it as racism - unless of course one is not
allowed to make /any/ joke which disparages someone, since no matter
what you say, it could be regarded as an -ism of some sort (racism,
sexism, blondism, whatever).
--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt>

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
 
Reply With Quote
 
Emmanuel Delahaye
Guest
Posts: n/a
 
      10-02-2005
Mark McIntyre wrote on 02/10/05 :
> On Sat, 01 Oct 2005 16:44:59 +0200, in comp.lang.c , "Emmanuel
> Delahaye" <(E-Mail Removed)> wrote:
>
>> Bruintje Beer wrote on 01/10/05 :
>>> "hokus" <(E-Mail Removed)> schreef in bericht
>>> news:dhemi4$8ql$(E-Mail Removed)...
>>>> Jak zapisać pętlę for, aby po każdej iteracji zmienna i1 zwiększała się o
>>>> 2, a i2 o 4.
>>>>
>>>> Dzięki
>>>
>>> sounds like you have drunk too much vodka

>>
>> There is a name for that: 'préjugé' or worst, 'racism'. In my country,
>> it's a crime.

>
> I imagine it was meant to be a joke.


It was not.

> Certainly I don't regard it as racism -


To emit a global judgement based on the origin of a person ? It is
racism.

Ok, we are off-topic...

--
Emmanuel
The C-FAQ: http://www.eskimo.com/~scs/C-faq/faq.html
The C-library: http://www.dinkumware.com/refxc.html

"It's specified. But anyone who writes code like that should be
transmogrified into earthworms and fed to ducks." -- Chris Dollin CLC


 
Reply With Quote
 
Mark McIntyre
Guest
Posts: n/a
 
      10-02-2005
On Sun, 02 Oct 2005 10:19:28 +0200, in comp.lang.c , "Emmanuel
Delahaye" <(E-Mail Removed)> wrote:

>Mark McIntyre wrote on 02/10/05 :
>> I imagine it was meant to be a joke.

>
>It was not.


How can you possibly know that it wasn't meant to be a joke? As it
happens I didn't think it was a particularly good joke, but it was
clearly meant to be humourous.

>> Certainly I don't regard it as racism -

>
>To emit a global judgement based on the origin of a person ? It is
>racism.


I don't see any *judgement* in the original post - the judgement was
made entirely by you.

If I had ten pee for every time someone's characterised scotsmen as
tight or unintelligible in a humorous moment, I'd be moderately
wealthy, as Scotsmen go. Does it bother me? No. Do I regard it as
racism? No.

Racism is when you get beaten up for being the in the wrong pub, or
for talking to a girl the wrong colour, or your house gets firebombed
for living in the wrong area, or you get spat on in the bus for having
a funny accent, or ...

Get a sense of proportion.
--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt>

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
why is int a[0] not allowed, but int* a = new int[0] is? haijin.biz@gmail.com C++ 9 04-17-2007 09:01 AM
Difference between int i, j; and int i; int j; arun C Programming 8 07-31-2006 05:11 AM
int a[10]; int* p=(int*)((&a)+1); But why p isn't equal to ((&a)+1)? aling C++ 8 10-20-2005 02:42 PM
int main(int argc, char *argv[] ) vs int main(int argc, char **argv ) Hal Styli C Programming 14 01-20-2004 10:00 PM
dirty stuff: f(int,int) cast to f(struct{int,int}) Schnoffos C Programming 2 06-27-2003 03:13 AM



Advertisments