Thread: strtok

  1. #1
    Registered User
    Join Date
    Sep 2004
    Posts
    719

    strtok

    error caused in MSVCRT.DLL

    src = "living room: 9:9:10 / door: 2:9 / Color: White" (not actual definition)

    Code:
    void Room::loadData(char *src)
    { 
        setName(strtok(src, ":/"));
        setColor(strtok(src, NULL));  //works fine without this line
        //strtok(src, NULL); //causes same error
    }
    for debugging purposes i'm trying to setColor to "9" (to keep from dealing with atof until i figure this out)

    am i using strtok correctly?
    i seem to have GCC 3.3.4
    But how do i start it?
    I dont have a menu for it or anything.

  2. #2
    Registered User
    Join Date
    Sep 2004
    Posts
    719
    pfft......nevermind............................... .......................................

    i'm such a chode
    i seem to have GCC 3.3.4
    But how do i start it?
    I dont have a menu for it or anything.

  3. #3
    Registered User
    Join Date
    Sep 2004
    Posts
    719
    since i already wasted this thread, is there an atod()? my compiler doesn't like that function. will atof() work just as well?
    i seem to have GCC 3.3.4
    But how do i start it?
    I dont have a menu for it or anything.

  4. #4
    Registered User jlou's Avatar
    Join Date
    Jul 2003
    Posts
    1,090
    I believe atof returns a double.

    And stringstreams work just as well.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. 20q game problems
    By Nexus-ZERO in forum C Programming
    Replies: 24
    Last Post: 12-17-2008, 05:48 PM
  2. strtok is causing segmentation fault
    By yougene in forum C Programming
    Replies: 11
    Last Post: 03-08-2008, 10:32 AM
  3. trying to use strtok() function to parse CL
    By ohaqqi in forum C Programming
    Replies: 15
    Last Post: 07-01-2007, 09:38 PM
  4. Help debugging my program
    By shoobsie in forum C Programming
    Replies: 4
    Last Post: 07-05-2005, 07:14 AM
  5. Trouble with strtok()
    By BianConiglio in forum C Programming
    Replies: 2
    Last Post: 05-08-2004, 06:56 PM