• Member Avatar
    zaxo311

    Marked Solved Status for Linux communicator project

    I have to write program in c linux for operating systems class - communicator using fifo which has to work like that: ./Speak create name (to create user) ./Speak send …
  • Member Avatar
    zaxo311

    Marked Solved Status for Reading from txt file into linked list

    So here's my problem I have inner structure inside of client. How can I know while reading from txt file that I'm reading item data or client data for my …
  • Member Avatar
    zaxo311

    Created Linux communicator project

    I have to write program in c linux for operating systems class - communicator using fifo which has to work like that: ./Speak create name (to create user) ./Speak send …
  • Member Avatar
    zaxo311

    Began Watching Linux communicator project

    I have to write program in c linux for operating systems class - communicator using fifo which has to work like that: ./Speak create name (to create user) ./Speak send …
  • Member Avatar
    zaxo311

    Replied To a Post in Reading from txt file into linked list

    Okay it's working like this not sure what was happening earlier huh, well after I read 1 token how can I acces data inside it to relink my list? void …
  • Member Avatar
    zaxo311

    Replied To a Post in Reading from txt file into linked list

    Not sure which is different but the thing which you posted works but while I'm doing with my fgets doesn't work kinda strange
  • Member Avatar
    zaxo311

    Replied To a Post in Reading from txt file into linked list

    Seems there's some problemw with fgets as when i put data into array same way as you did it works for me and aswell this: char *result = fgets(line,sizeof(line),fp); printf("%s …
  • Member Avatar
    zaxo311

    Replied To a Post in Reading from txt file into linked list

    That's how my file looks Client: z q Item: kupa kkk 123.000000 kk 12.000000 Client: z c Item: kupaaaz jkk 2.000000 k 3.000000
  • Member Avatar
    zaxo311

    Replied To a Post in Reading from txt file into linked list

    Well I tried with this printf("CLIENT") to see if this is even getting to strcmp but it doesnt char *token = strtok(line," "); puts(token); After checking what's inside of 1st …
  • Member Avatar
    zaxo311

    Replied To a Post in Reading from txt file into linked list

    Basicaly smth like this to read if client? Btw not sure why but if here I try to use puts(token) i get garbage data not Client: void ReadList(struct client *head) …
  • Member Avatar
    zaxo311

    Replied To a Post in Reading from txt file into linked list

    Could you explain how exactly strtok works? It's first time I'm seeing it, from what it seems it takes part of readen data from fgets but you say that after …
  • Member Avatar
    zaxo311

    Replied To a Post in Reading from txt file into linked list

    But how to check if line which I read from txt file starts with Client? Should I use some specific function and check line with strncmp for few first letters …
  • Member Avatar
    zaxo311

    Replied To a Post in Reading from txt file into linked list

    If I add those Client:, Item: at beginning of each line , how to read such file?
  • Member Avatar
    zaxo311

    Created Reading from txt file into linked list

    So here's my problem I have inner structure inside of client. How can I know while reading from txt file that I'm reading item data or client data for my …
  • Member Avatar
    zaxo311

    Began Watching Reading from txt file into linked list

    So here's my problem I have inner structure inside of client. How can I know while reading from txt file that I'm reading item data or client data for my …
  • Member Avatar
    zaxo311

    Marked Solved Status for Deleting node from nested list

    I'm trying to make make project for my programming class. All that's left is deleting elements and editing elements. Basicaly my question is how would I do it for my …
  • Member Avatar
    zaxo311

    Replied To a Post in Deleting node from nested list

    So basicaly all I should change is this current = prev->next and unless I want to delete all items with given name break loop?I guess that's all I needed got …
  • Member Avatar
    zaxo311

    Replied To a Post in Deleting node from nested list

    So I wrote code to delete item it seems to be working could you check if everything is right? void DeleteItem(struct client *head,char name[30]) { struct item *current = head->item_data,*prev …
  • Member Avatar
    zaxo311

    Replied To a Post in Deleting node from nested list

    Okay writting code for edit was pretty simple got it done all thats left is how to delete single node from inner list. I understand that if I want to …
  • Member Avatar
    zaxo311

    Replied To a Post in Deleting node from nested list

    So to change for example name and last name of client I would have to use function find and pass node pointer to function where I changedata, malloc new data …
  • Member Avatar
    zaxo311

    Replied To a Post in Deleting node from nested list

    So basicaly to delete whole list it would be like this? Seems to be working for me not sure if I'm doing it right thought. Could you aswell explain how …
  • Member Avatar
    zaxo311

    Created Deleting node from nested list

    I'm trying to make make project for my programming class. All that's left is deleting elements and editing elements. Basicaly my question is how would I do it for my …
  • Member Avatar
    zaxo311

    Began Watching Deleting node from nested list

    I'm trying to make make project for my programming class. All that's left is deleting elements and editing elements. Basicaly my question is how would I do it for my …
  • Member Avatar
    zaxo311

    Marked Solved Status for Nested singly linked list

    Im writing project for my programming lessons and right now got some problems with output from function AddItemToClient, basicaly its mainly with date, in first node its correct one but …
  • Member Avatar
    zaxo311

    Replied To a Post in Nested singly linked list

    It works thanks to code you provided, thanks.
  • Member Avatar
    zaxo311

    Created Nested singly linked list

    Im writing project for my programming lessons and right now got some problems with output from function AddItemToClient, basicaly its mainly with date, in first node its correct one but …
  • Member Avatar
    zaxo311

    Began Watching Nested singly linked list

    Im writing project for my programming lessons and right now got some problems with output from function AddItemToClient, basicaly its mainly with date, in first node its correct one but …
  • Member Avatar
    zaxo311

    Marked Solved Status for Linked list problem

    I have following problem: I have 2 structures: Clients and items for example structure clients would have name and list of items from another structure asigned to this specific name …
  • Member Avatar
    zaxo311

    Replied To a Post in Linked list problem

    Well thanks to your help and my programming teacher figured how to do it ,thanks.
  • Member Avatar
    zaxo311

    Replied To a Post in Linked list problem

    Ah sorry, this function is not neccessary. Just posted whole code on which I have been working. Only important functions are dodajprzedmiot,dodaj,find and wypisz liste. Sorry for writting it all …

The End.