title: How to pass dictionary values without having to iterate using a loop in c#
body: <p>I am using Dictionary class as follows</p>
  
  <pre><code>Dictionary&lt;string, string&gt; dict = new Dictionary&lt;string, string&gt;()
  {
     {"1", "One"} 
     {"2", "Two"}
     {"3", "three"}
     {"4", "four"}
  };
  </code></pre>
  
  <p>Now I am trying to get the value of each of the keys and pass them as parameter to a function. Something like :</p>
  
  <pre><code>myFunction(&lt;get the first key and pass its value as parameter&gt;);
  myFunction(&lt;get the second key and pass its value as parameter&gt;);
  myFunction(&lt;get the third key and pass its value as parameter&gt;);
  myFunction(&lt;get the fourth key and pass its value as parameter&gt;);
  </code></pre>
  
  <p>So these are four calls to the function.</p>
  
  <p>I cannot use a for loop here obviously because if I do so, say for example I start the loop from 1, then the value for the first run of the loop will be 1 and it will pick up the first key throughout these four calls of the function which I do not want. I want to get 1 in the first call of the functions, get second value in the second call and so on.</p>
  
  <p>I am not able to figure out a way to do this. Any suggestions would be of great help.</p>