Skip to content

Instantly share code, notes, and snippets.

@imSrbh
Created February 20, 2020 04:24
Show Gist options
  • Save imSrbh/596a2dbd7add8fb449aea3c60c84763e to your computer and use it in GitHub Desktop.
Save imSrbh/596a2dbd7add8fb449aea3c60c84763e to your computer and use it in GitHub Desktop.
/*
* helloglib.c
* Using glib libraries to do a hello world
* Compile with:
* gcc helloglib.c `pkg-config --cflags --libs glib-2.0` -o helloglib
*/
#include <glib.h>
int
main (void)
{
GString *my_string = g_string_new("This Hello world is %d chars long\n");
g_print(my_string->str, my_string->len);
g_string_free(my_string, TRUE);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment