I\'ve gotta be missing something simple here.
Take the following code:
public IEnumerable getInt(){
for(int i = 0; i < 10; i++){
y
My advice: don't mess around with the enumerators at all. Characterize your problem as a series of operations on sequences. Write code to express those operations. Let the sequence operators take care of managing the enumerators.
So let's see if I've got this straight. You have two sequences. Let's say { 2, 3, 5, 7, 12 } and { "frog", "toad" }. The logical operation you want to perform is, say "go through the first sequence. Every time you find a number divisible by three, get the next item in the second sequence. Do something with the resulting (number, amphibian) pair."
Easily done. First, filter the first sequence:
var filtered = firstSequence.Where(x=>x%3 == 0);
Next, zip the filtered sequence with the second sequence:
var zipped = filtered.Zip(
secondSequence,
(y, z)=> new {Number = x, Amphibian = y});
And now you can iterate over the zipped sequence and do whatever you want with the pairs:
foreach(var pair in zipped)
Console.WriteLine("{0} : {1}", pair.Number, pair.Amphibian);
Easy peasy, no messing about with enumerators.