Zig
1 Follower 3 Questions

Zig is a low-level programming language focused on performance, safety, and cross-compilation. It aims to replace C by eliminating undefined behavior and offering a simpler toolchain. Zig is gaining attention for systems programming and embedded development.

How to compare strings in Zig?

I'm learning Zig and want to know the proper way to compare strings. I see that strings are slices ([]const u8), but how do I: - Check if two strings are equal - Do a case-insensitive comparison What functions or standard library utilities should I use for these common...

0 votes 3 views No Answers Asked about 1 month ago
J
J Early User
109
How can I convert an integer to a string in Zig?

Forgive me but I'm pretty new to Zig and need to convert an integer (e.g. i32) into a string for display purposes. What's the idiomatic way to do this in Zig at runtime, and are there different approaches depending on the integer type or allocation needs?

1 vote 14 views 1 Answer Asked about 2 months ago
J
J Early User
109
How to parse an integer from a string in Zig?

What is the proper way to parse an integer from a string in Zig, while being able to specify the resulting integer type? How would I convert foo to an i32, for example?

3 votes 45 views 1 Answer Asked about 2 months ago
J
J Early User
109