title: How can I stop scanf-ing input after a certain character?
body: <p>I'm working on a function that takes filepaths and dices them up into smaller sections.</p>
  
  <p>For example, if the input parameter was "cd mypath/mystuff/stack/overflow/string", I want to be able to return "cd" "mypath", "mystuff", "stack", "overflow", and "string" in succession.</p>
  
  <p>While I could simply continually use "getchar", appending the results to an ever-increasing string, stopping when getchar returns a '/', I feel like there <em>must</em> be a more elegant way to achieve the same functionality.</p>
  
  <p>Any ideas?</p>