Search:

Type: Posts; User: timgao

Search: Search took 0.01 seconds.

  1. Replies
    20
    Views
    2,246

    That is just about strcpy itself. How can I use...

    That is just about strcpy itself. How can I use this to insert string to the struct?
  2. Replies
    20
    Views
    2,246

    inside struct I need to have : struct node {...

    inside struct I need to have :


    struct node {
    char *string;
    struct node *next;
    };

    can you give me some more details about strcpy(structure I can find out)?
    I mean where shall I use it?
  3. Replies
    20
    Views
    2,246

    I found out the problem above, I don't know why...

    I found out the problem above, I don't know why but the code works fine on another compiler.

    A new question how to insert string into a list.
    I tried numbers. It's fine. but not with string.

    ...
  4. Replies
    20
    Views
    2,246

    I do not quite get your point. you say I have a...

    I do not quite get your point. you say I have a \n in the line. I think so too. It's at the end of the line. Am I supposed to have it in the line? I think I need \n for fgets to find out the line....
  5. Replies
    20
    Views
    2,246

    strcspn(token, " \n"); works fine. that is my...

    strcspn(token, " \n"); works fine.
    that is my question what's wrong with " "
  6. Replies
    20
    Views
    2,246

    I have got some new problems while search for \n...

    I have got some new problems while search for \n in the text
    the code works fine but it does not work when I change "\n" to " ".

    text file is still the same.

    name1 telephone1 1
    name2...
  7. Replies
    20
    Views
    2,246

    Thank both of you I will give a try. See if I...

    Thank both of you I will give a try. See if I have any more questions later.
  8. Replies
    20
    Views
    2,246

    so look for space every time but how can I move...

    so look for space every time but how can I move to the next node? look for \n?
  9. Replies
    20
    Views
    2,246

    the text file looks like: Name telephone...

    the text file looks like:

    Name telephone seetnumber \n
    Name telephone seetnumber \n
    Name telephone seetnumber \n

    code for loading file


    int fileSize(char* filename) {
  10. Replies
    20
    Views
    2,246

    I know that. but how can I find out different...

    I know that. but how can I find out different names the file is just a piece of text. I do have spaces and \n in the text but How to really get them out and put into the right node.
  11. Replies
    20
    Views
    2,246

    how can I load a file into a stuct

    I have a list of names in the file. I want to load it into a struct list every time before I insert any new names.
    I can only load the data into an array how can I put it into list nodes?
Results 1 to 11 of 11