Просмотр исходного кода

ex10 - missing type was confusing and tangential (#12)

Dave Gauer 4 лет назад
Родитель
Сommit
ee8fbbd65d
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      exercises/10_if2.zig

+ 1 - 1
exercises/10_if2.zig

@@ -10,7 +10,7 @@ pub fn main() void {
 
     // Please use an if...else expression to set "price".
     // If discount is true, the price should be $17, otherwise $20:
-    var price = if ???;
+    var price: u8 = if ???;
 
     std.debug.print("With the discount, the price is ${}.\n", .{price});
 }