Skip to content

ex17.c  #25

@r3verser

Description

@r3verser

Tried this lesson, but got error. Have retyped it from book, but same thing happens! Could somebody help me with it?:zipper_mouth_face: Im on Windows.

app.exe db.dat c

Creates file db.dat 101kb size

app.exe db.dat s 1 zed [email protected]

Fires
ERROR: Failed to load database.

Debugger said it happends at fread(), it returns 0 somehow

int rc = fread(conn->db, sizeof(struct Database), 1, conn->file);

void Database_load(struct Connection* conn)
{
	int rc = fread(conn->db, sizeof(struct Database), 1, conn->file);
	if (rc != 1)
		die("Failed to load database.");
}

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