Created
January 14, 2014 18:09
-
-
Save 17twenty/8422857 to your computer and use it in GitHub Desktop.
Hello World using GLib
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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