1. Welcome to TRD Forums! A community for Toyota, Lexus, and Scion Enthusiasts. To enjoy all the benefits of the site, we invite you to signup.

Tech tokenization in C++

Discussion in 'Off Topic' started by moonshadow, Jul 28, 2005.

  1. Offline

    moonshadow ||\\|||D)||\\||

    Message Count:
    1,274
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Jersey City, NJ
    tokenization in C++

    so here's a function

    const char* ststat = mysql_stat(mData);//mData);
    printf("%s\n\n" , ststat);

    const char* stat;
    stat = strtok (ststat, " ");
    while (stat != NULL)
    {
    printf ("%s\n", stat);
    stat = strtok (NULL, " ,.");
    }


    it tokenizes a string so say if the string said

    My name is Joe

    it would make it

    My
    name
    is
    Joe

    i need to store each of those split up words in a new variable like make val1 My and val2 name and so on. Can anyone help. It seems pretty elementary but every route i've tried has failed so far :superconf
  2. Offline

    AE102 New Member

    Message Count:
    2,569
    Likes Received:
    0
    Trophy Points:
    0
    omg what the hell is this? lol...
  3. Offline

    moonshadow ||\\|||D)||\\||

    Message Count:
    1,274
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Jersey City, NJ
  4. Offline

    AE102 New Member

    Message Count:
    2,569
    Likes Received:
    0
    Trophy Points:
    0
    i dunno computers lol... C++ is what i have in school :p
  5. Offline

    moonshadow ||\\|||D)||\\||

    Message Count:
    1,274
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Jersey City, NJ
    i need to find a way to get that value stored or i wont be able to finish this stuff today and then i'll have to come to work tomorrow too :( which sucks cuz i'm goin out tonight with....... :p
  6. Offline

    AE102 New Member

    Message Count:
    2,569
    Likes Received:
    0
    Trophy Points:
    0
    what do you do for a living?
  7. Offline

    e_andree E

    Moderator
    Message Count:
    8,246
    Likes Received:
    13
    Trophy Points:
    578
    Location:
    MD
    Wow...no wonder computer programmers get burnt out. I would kill myself if thats what I did for a living!
  8. Offline

    AE102 New Member

    Message Count:
    2,569
    Likes Received:
    0
    Trophy Points:
    0
    too much math and science....heads gonna hurt like fuck lol...
  9. Offline

    moonshadow ||\\|||D)||\\||

    Message Count:
    1,274
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Jersey City, NJ
    i'm a "database developer" basically i sit there and program in C++ all f'in day :)
  10. Offline

    AE102 New Member

    Message Count:
    2,569
    Likes Received:
    0
    Trophy Points:
    0
    wow lol...that looks fun :)
    bet you get paid good..
  11. Offline

    moonshadow ||\\|||D)||\\||

    Message Count:
    1,274
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Jersey City, NJ
    haha only reason i'm still here :p
  12. Offline

    laz Member

    Message Count:
    634
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    NYC
    Man, did the hire you right out of school? Or do you have no one to turn to at work for advice? It seems simple enough that you would find something on the web.

    Dude, google is your friend!

    X
  13. Offline

    moonshadow ||\\|||D)||\\||

    Message Count:
    1,274
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Jersey City, NJ
    umm its mostly cuz i dont program in C++ i'm trying to store it into an array. seems to be working so far.
  14. Offline

    1337Rolla oh my

    Administrator
    Message Count:
    3,979
    Likes Received:
    31
    Trophy Points:
    748
    what's a String?? :p No such thing in C++

    gah, was going to say use an array; or depending on the amount of data you're handling a linked-list.
  15. Offline

    moonshadow ||\\|||D)||\\||

    Message Count:
    1,274
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Jersey City, NJ
    yeah they seem to not want to work. iono haha. i did the whole thing differently though :p
  16. Offline

    1337Rolla oh my

    Administrator
    Message Count:
    3,979
    Likes Received:
    31
    Trophy Points:
    748
    no clue :superconf check the datatypes before you're storing them in the array.. make sure there's no mismatches.

    I dunno what else 2 say.
  17. Offline

    moonshadow ||\\|||D)||\\||

    Message Count:
    1,274
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Jersey City, NJ
    lol yeah i think thats what the problem was but it didnt help. oh well screw it. its only work right :p
  18. Offline

    Roxtar New Member

    Message Count:
    47
    Likes Received:
    0
    Trophy Points:
    0
    c'mon, just dump it all into a vector... or, if you want to go the long way, kick each token out to a file on a new line, and then read them all back in and store them however you want
  19. Offline

    moonshadow ||\\|||D)||\\||

    Message Count:
    1,274
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Jersey City, NJ
    hahaha i didnt even think about a vector. oops too late now
  20. Offline

    Ellada New Member

    Message Count:
    155
    Likes Received:
    0
    Trophy Points:
    0

    and you can't solve your own problem?

    somebody is full of it... :shutup:

Share This Page