mirror of
https://github.com/ziglang/zig.git
synced 2024-11-30 09:02:32 +00:00
16 lines
236 B
Zig
16 lines
236 B
Zig
const x = 1234;
|
|
|
|
fn foo() void {
|
|
// It works at file scope as well as inside functions.
|
|
const y = 5678;
|
|
|
|
// Once assigned, an identifier cannot be changed.
|
|
y += 1;
|
|
}
|
|
|
|
pub fn main() void {
|
|
foo();
|
|
}
|
|
|
|
// exe=build_fail
|