parsing a string.. how do u do this?

This is a discussion on parsing a string.. how do u do this? within the C++ Programming forums, part of the General Programming Boards category; where can i begin looking into string parsing. if i wanna get inupt from a user in fraction format (y/z) ...

  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,662
    "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,831
    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, 05:05 AM
  2. String parsing
    By broli86 in forum C Programming
    Replies: 3
    Last Post: 07-03-2008, 06: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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21