mirror of
https://codeberg.org/ziglings/exercises.git
synced 2025-06-08 01:57:02 +09:00
Update exercises/045_optionals.zig
Add '?' in the print to silence compiler error: '@compileError("cannot format optional without a specifier (i.e. {?} or {any})");'
This commit is contained in:
parent
dfdaf03d99
commit
d646af4390
1 changed files with 1 additions and 1 deletions
|
@ -31,7 +31,7 @@ pub fn main() void {
|
|||
// integer value from deepThought() OR the number 42:
|
||||
const answer: u8 = result;
|
||||
|
||||
std.debug.print("The Ultimate Answer: {}.\n", .{answer});
|
||||
std.debug.print("The Ultimate Answer: {?}.\n", .{answer});
|
||||
}
|
||||
|
||||
fn deepThought() ?u8 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue