String vs. Stream?

Discussion in 'C' started by RichSelian, Aug 31, 2010.

  1. RichSelian

    RichSelian New Member

    Joined:
    Aug 31, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    I've written a function to do some lexical analysis as following:
    Code:
    struct Token* GetToken(FILE* stream, int* line, int* column);
    Now in another project I want to write an expression calculator. The first step is to cut the expression into tokens. So I want to use my GetToken() method. But the ploblem is, my expression is stored in a string, just as "char expression[512];". How can my function GetToken() work on a string?
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice