Skip to content

zakarouf/print.h

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

print.h

Generic print comes to C made for z_ inspired by many that came before.


3 months ago I saw Generic-Print in the r/C_Programming subreddit. I set my first foot into C macros and then Hirrolot's Metatlang99 and Datatype99 pushed me the world of meta-programming.


This repository is a homage to them and their hardwork. 3 months I did not even knew Python-style generic print was even possible for C let alone making it. Projects such as P99, Cloak, Metatlang99 have made it possible.



Before Delving into, I want to make it clear that this repo, just solely is to preview the print.h. The print.h is already is in the z_ Library. So, please use the z_ library instead.

Or Use Generic-Print instead.

Printing with print.h

print.h requires the z_ Library to work

#include "print.h"
z__print("Hello, World!");

Output
hello_world

Printing Primitive Types.
#include "print.h"

int a = 4, b = a+a;
char str[] = "Numbers";

z__print(str, a, b, 3.0f/2);

Output
out_prim

Printing z_ Types.
#include "print.h"

z__Vector3 cord = {{10, 10, 32}};
z__u32Arr array_num = z__Arr_init(z__u32Arr , 1, 2, 3);
void *F = array_num.data;

z__print("Array =>", array_num, "\n",
         "Vector =>", cord, "\n",
         "Pointer =>", F);

Output generic

See also

About

Generic print comes to C made for `z_`

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages