title: How to read first character of a String in C
body: <p>Given a String <code>"Hello"</code> in C, how would a method look that returns the <code>"H"</code> in the String. </p>
  
  <p>Then once I've determined how to do that, I'd like to take it a step further and remove the first character from the initial String so that the next time that I read it <code>"Hello"</code> becomes <code>"ello"</code>, and when I call the read method again it will return the <code>"e"</code>? </p>
  
  <p>I know how to do this in other languages, like Java but I'm not as proficient in C so I'm really struggling with this concept.</p>
  
  <p>Here's how I would do this in java.</p>
  
  <pre><code>public class Program1 {
  
  private String expression = "-(1+3)*4/6";
  
  public String cut_string(String word)
  {
  
      String temp = word.substring(1, word.length());
      return temp;
  }
  
  public char readToken()
  {
      if(expression.length() &gt; 1)
      {
          char token = expression.charAt(0);
          expression = cut_string(expression);
          return token;
      }else {
          System.out.print("BROKEN AT READ TOKEN");
          return ' ';
      }
  
  }
  
  public String getExpression()
  {
      return expression;
  }
  
  public static void main(String [] args)
  {
      Program1 thing = new Program1();
  
  
      System.out.println("The token was: " + thing.readToken()
              + "\n" + "The remaining String is: " 
                  + thing.getExpression());
  
      System.out.println("The token was: " + thing.readToken()
              + "\n" + "The remaining String is: " 
                  + thing.getExpression());
  
      System.out.println("The token was: " + thing.readToken()
              + "\n" + "The remaining String is: " 
                  + thing.getExpression());               
  }
  }
  </code></pre>
  
  <p>The output would be as follows:</p>
  
  <pre><code>The token was: -
  
  The remaining String is: (1+3)*4/6
  
  The token was: (
  
  The remaining String is: 1+3)*4/6
  
  The token was: 1
  
  The remaining String is: +3)*4/6
  </code></pre>