summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucas Faria Mendes <lucas.oliveira1676@etec.sp.gov.br>2025-12-05 09:02:56 +0000
committerLucas Faria Mendes <lucas.oliveira1676@etec.sp.gov.br>2025-12-05 09:02:56 +0000
commitc4698149c99b61e397a5d628c9d127350d299f67 (patch)
tree0b72210d738fadc629d069ac15620406f9b13819
parent1106d20cea315f007fb87e03b5d16c71dd48d6cf (diff)
downloadsqlite-zig-c4698149c99b61e397a5d628c9d127350d299f67.tar.gz
sqlite-zig-c4698149c99b61e397a5d628c9d127350d299f67.zip
codecrafters submit [skip ci]
-rwxr-xr-xsrc/main.zig16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/main.zig b/src/main.zig
index eb8124b..8154bf7 100755
--- a/src/main.zig
+++ b/src/main.zig
@@ -23,15 +23,11 @@ pub fn main() !void {
var file = try std.fs.cwd().openFile(database_file_path, .{});
defer file.close();
- // You can use print statements as follows for debugging, they'll be visible when running tests.
- std.debug.print("Logs from your program will appear here!\n", .{});
-
- // TODO: Uncomment the code below to pass the first stage
- // var buf: [2]u8 = undefined;
- // _ = try file.seekTo(16);
- // _ = try file.read(&buf);
- // const page_size = std.mem.readInt(u16, &buf, .big);
- // try stdout.print("database page size: {}\n", .{page_size});
- // try stdout.flush();
+ var buf: [2]u8 = undefined;
+ _ = try file.seekTo(16);
+ _ = try file.read(&buf);
+ const page_size = std.mem.readInt(u16, &buf, .big);
+ try stdout.print("database page size: {}\n", .{page_size});
+ try stdout.flush();
}
}