Originally Posted by
mariostg
Something stupid must be going on. I really can't figure what I am doing wrong
Code:
gchar *t="LeftSide:RightSide";
Above, you defined t as a char pointer. It points to a string literal. String literals are read-only in C.
Originally Posted by
mariostg
Code:
g_strdelimit(t, ":", '|');
Above, the g_strdelimit() function will try to modify the string pointed to by t, but because it is read-only, you'll get a segmentation violation.
What you intended, obviously, was to declare a string variable, initialized to your string, right? That would be
Code:
gchar t[] = "LeftSide:RightSide";
The difference between this one and the one you used that here, the string literal only defines the initial value of the char array t, whereas in your code, you defined t to point to the string literal itself.