Skip to content

add_key function isn't functioning as expected #4

Description

@prajwalkpatil

The add_key function in inventory.c is not adding the key and values to the table correctly

    // Read the data from file and load into the main memory
    while (!feof(fp))
    {
        fscanf(fp, "%s %s", key, property);
        strcpy(inventory[index][key_count], property);
        index++;
    }
  • String named key is kept unused throughout the function.
  • The data read by that function is messing up the whole inventory table in the secondary memory when it is opened for the second time.

When table is viewed after updating, it is incomplete even if key and all the values are added

table_issue

When program is rerun and the table is fetched from the secondary storage, The whole table appears to be messed up.

messedtable_issue

Is it an issue or am I going wrong somewhere?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions