Learnxinyminutes.com for zig

I am going through Learn Zig in Y Minutes and there is a link to the src code: https://learnxinyminutes.com/files/learnzig.zig

I had expected this to be working code, but there are various errors like undefined print function, print called outside of a function, missing ‘;’.

Does anyone have a working version of this file by any chance ?

I had expected this to be working code

I checked C++, C, and rust X in Y minutes pages and only rust one can be compiled. But errors mostly about reusing main identifier or to demonstrate what something won’t compile.
On the other hand some code in Learn Zig in Y Minutes is outdated and won’t compile even with trivial code fixes like in C++,C.

That page seems to be out of date with current Zig, but it looks like it was always a bit incomplete and flawed. For similar commented code samples, I would just recommend the language reference. It’s been a while since I read it, but Karl Seguin’s Learning Zig page seems up to date and is probably still excellent.

3 Likes