LibC to Zig

Comparison between libc functions and their best fitting zig alternatives

Objectives

  • To make it easy for new Zig developers coming from a C background
  • To define the best practices in Zig in lieau with traditional C Code
  • To provide enough material for developers who are willing to transition old legacy C code to Zig

Pre-requisite

  • Developer must know basics of Zig (If not, go through ziglearn)
  • Developer has programmed in C before

Table of Contents

Tips & Tricks Headers
Handling strings <assert.h>
Allocator <complex.h>
Pointers <ctype.h>
<errno.h>
<fenv.h>
<float.h>
<inttypes.h>
<iso646.h>
<limits.h>
<locale.h>
<math.h>
<setjmp.h>
<signal.h>
<stdalign.h>
<stdarg.h>
<stdatomic.h>
<stdbool.h>
<stddef.h>
<stdint.h>
<stdio.h>
<stdlib.h>
<stdnoreturn.h>
<string.h>
<tgmath.h>
<threads.h>
<time.h>
<uchar.h>
<wchar.h>
<wctype.h>

Contributing

Conrtibutions are welcome:

https://github.com/zig-community/libc-to-zig

License

MIT