Thread: parsing a string.. how do u do this?

  1. #1
    Registered User
    Join Date
    Dec 2002
    Posts
    221

    parsing a string.. how do u do this?

    where can i begin looking into string parsing. if i wanna get inupt from a user in fraction format (y/z) or in mixed number format (x y/z), and be able to differentaite them
    thanks

  2. #2
    Registered User
    Join Date
    Apr 2003
    Posts
    2,663
    "where can i begin looking into string parsing."

    Your imagination--just like where the solutions for every other problem are found.

  3. #3
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    A truly stupid question, answered well.

    Come on! How do you expect someone to answer that? What kind of string? How did you get it? What results do you want? What OS? Compiler?
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  4. #4
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    you can use stringstreams to parse what you need from a string. Search the string for a space after some input but befor '/' and you have a whole and frac else just a frac. Use stringstreams to do the parsing.
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. char Handling, probably typical newbie stuff
    By Neolyth in forum C Programming
    Replies: 16
    Last Post: 06-21-2009, 04:05 AM
  2. String parsing
    By broli86 in forum C Programming
    Replies: 3
    Last Post: 07-03-2008, 05:06 PM
  3. Message class ** Need help befor 12am tonight**
    By TransformedBG in forum C++ Programming
    Replies: 1
    Last Post: 11-29-2006, 11:03 PM
  4. Replies: 4
    Last Post: 03-03-2006, 02:11 AM
  5. creating class, and linking files
    By JCK in forum C++ Programming
    Replies: 12
    Last Post: 12-08-2002, 02:45 PM