Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <string.h>
- #include <glib.h>
- #include <glib/gprintf.h>
- void foo (const gchar *str) {
- str = "Tu es beau";
- }
- void foo_gtk (const gchar *str) {
- gchar *str2 = g_strndup (str, strlen(str));
- g_stpcpy (str2, "Tu es bof");
- g_free (str2);
- }
- int main (int argc, char **argv) {
- const gchar *str = "Tu es moche";
- foo (str);
- g_printf ("%s\n", str);
- foo_gtk (str);
- g_printf ("%s\n", str);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement