Go Down

Topic: a simple one --   for in (Read 459 times) previous topic - next topic

npuckett

Jul 23, 2008, 08:55 am Last Edit: Jul 23, 2008, 08:56 am by npuckett Reason: 1
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

kg4wsv

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

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

-j


npuckett

that's fair enough...

thanks for the info


Go Up