authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-01-07 01:59:23-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-01-07 01:59:23-05:00
log32ba0dcea953a044b509081b583b3eed3b27b577
tree8bb3e9fea03af2d5b08103c5496eb77c10462be5
parente7c04b6df2d839a25cc4e2cf8da900c7dd04bc7d

update hello world docs


1 files changed, 3 insertions(+), 4 deletions(-)

doc/langref.html.in+3-4
......@@ -264,15 +264,14 @@
264264 please <a href="https://github.com/zig-lang/www.ziglang.org/issues/new?title=I%20searched%20for%20___%20in%20the%20docs%20and%20didn%27t%20find%20it">file an issue</a> or <a href="https://webchat.freenode.net/?channels=%23zig">say something on IRC</a>.
265265 </p>
266266 <h2 id="hello-world">Hello World</h2>
267 <pre><code class="zig">const io = @import("std").io;
267 <pre><code class="zig">const std = @import("std");
268268
269269pub fn main() -&gt; %void {
270270 // If this program is run without stdout attached, exit with an error.
271 var stdout_file = %return io.getStdOut();
272 const stdout = &amp;stdout_file.out_stream;
271 var stdout_file = %return std.io.getStdOut();
273272 // If this program encounters pipe failure when printing to stdout, exit
274273 // with an error.
275 %return stdout.print("Hello, world!\n");
274 %return stdout_file.write("Hello, world!\n");
276275}</code></pre>
277276 <pre><code class="sh">$ zig build-exe hello.zig
278277$ ./hello