by pRusya · 1y ago · 0 comments
Tbh syntax-wise Zig feels more cryptic[1] at first than C++.
[1] e.g. `extern "user32" fn MessageBoxA(?win.HWND, [*:0]const u8, [*:0]const u8, u32) callconv(win.WINAPI) i32;` from https://ziglang.org/learn/samples/
#include <windows.h>
extern "C" __declspec(dllimport) int __stdcall MessageBoxA(HWND, LPCSTR, LPCSTR, UINT);
// or
extern "C" __declspec(dllimport) int __stdcall MessageBoxA(void *, const char[], const char[], unsigned int);
It's not exactly a stellar improvement. #include <windows.h>
int main() {
MessageBoxA(NULL, "world!", "Hello", 0);
return 0;
}