Search:

Type: Posts; User: robin2aj

Search: Search took 0.00 seconds.

  1. I do have other reasons for stripping the...

    I do have other reasons for stripping the newline. Thanks for the help. I'm using [^\n] and it seems to be working how I expect it to.
  2. so I should be able to do this? [code] ...

    so I should be able to do this?
    [code]

    sscanf(token, "%d,%d,%[^NULL]", &type, &code, description);

    [\code]
  3. I have actually already stripped the \n out of...

    I have actually already stripped the \n out of the token and replaced it with a \0. I'm still unsure how to do this. Are you saying use the %[^\n] but I can't use sscanf anymore??
  4. sscanf need to include spaces in character string

    I am reading some comma separated values in from a file and I need to read the last one as a character string, however the string may include white space and I can't get it to work correctly. it...
  5. Replies
    3
    Views
    1,493

    1. Thanks! 2. So since there are commas...

    1. Thanks!

    2. So since there are commas separating the values, sscanf will recognize the commas in the format string and not include them in the data?
  6. Replies
    3
    Views
    1,493

    Array or Structs? and using sscanf

    I have two questions:

    1. Can I have an array of structs and if so, how do I define it? I know how to define a struct, but not an array of structs if its possible.

    2. If I have a csv string...
  7. Thanks for the help guys!

    Thanks for the help guys!
  8. Thanks! Do you know where I can find a list of...

    Thanks! Do you know where I can find a list of all the "%hd" things. What does %hd mean? Hexidecimal?
  9. store string data as a short or other data type

    I need to read variable-value pairs from a file. Some of the values are character strings, some are integers, and some need to be stored as shorts. I know how to use strtok to tokenize the lines...
  10. Replies
    4
    Views
    1,871

    Beej's Guide to C Programming...

    Beej's Guide to C Programming


    read this section. you should be able to figure it out from the information there. Good luck. I'm a noob to C also and I found that tutorial as well as this forum...
  11. I figured it out. Thanks so much for the help...

    I figured it out. Thanks so much for the help guys. You have NO idea how long I sat and stared at this. Although I feel like I should have realized what was happening, I'm just not all that familiar...
  12. is that the same problem with the group name too?...

    is that the same problem with the group name too? is that why, at the end when I print out all the variables, the group name is apparently empty?

    and how would I do the allocation?...
  13. well...this is what the output gives me token...

    well...this is what the output gives me

    token = group1
    groupName = group1
    token = 7
    timeToRun = 7token = log.txt
    logFilename = log.txt
    Groupname = TimeToRun = 7 ConfigFilename =...
  14. New to C trouble with strtok and storing the values

    I need to read variable name and value combinations from a config file and store the results. I seem to be having no trouble storing the int value, but the strings I am having trouble with. In the...
Results 1 to 14 of 16