Pages: [1]   Go Down
Author Topic: a simple one --   for in  (Read 373 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 12
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I came across this last night and was wondering..
can the arduino IDE use for in loops? I looked in the docs and tried how I would normally write it, but it gave errors.

ex
int list[] ={1,2,3,4,5};
int thing;

for (thing in list)
{
..do stuff to the list
}

I understand it can be done with a normal for loop , but I was just curious as some times they are a bit cleaner.

thanks

Nick
« Last Edit: July 23, 2008, 01:56:26 am by npuckett » Logged

0
Offline Offline
Faraday Member
**
Karma: 7
Posts: 2526
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Nope, no for in loops - this ain't perl. smiley

for in isn't standard C, either, unless something changed while I wasn't looking.

-j

Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 12
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

that's fair enough...

thanks for the info

Logged

Pages: [1]   Go Up
Jump to: