title: split/parse and get value from a char array
body: <p>I want to write a function in C, by which I can get value of the tag from a char array ::</p>
  
  <p>Example ::         </p>
  
  <pre><code>char a[]="name=RRR&amp;school=AAA&amp;roll=111&amp;address=SSS";
  </code></pre>
  
  <p>I want to write a function - if I give "name" as a parameter of the function then the function will return RRR                           --- if I give "school" as a parameter of the function then the function will return AAA</p>
  
  <p>i have done it in Java ... </p>
  
  <pre><code>    public String getTagValue(String toSplit, String tag)
  {
      String CommandTypeValue="";
      String[] FirstSplit;
      String[] SecondSplit;
  
      String delims = "&amp;";
      FirstSplit = toSplit.split(delims);
  
      for(int i=0; i&lt;FirstSplit.length; i++ )
      {
          delims = "=";
          SecondSplit = FirstSplit[i].split(delims);
          if(SecondSplit[0].equals(tag))
              return SecondSplit[1];
          //System.out.println(SecondSplit[0] +" "+ SecondSplit[1]);
      }
  
      return CommandTypeValue;
  
  }
  </code></pre>
  
  <p><strong>How to do it C ?? any easy library or function ??</strong></p>