You should do it in this way:
gchar **options={"/usr/bin/gcc", "-v", NULL};

options[i] can't be initiated on run. YOu have to use
'strcpy()' after malloc space.

regards

 --- Ronald Bultje <[EMAIL PROTECTED]>
的正文:> Hey,
> 
> On Thu, 2003-04-03 at 14:06, [EMAIL PROTECTED]
> wrote:
> >   gchar **options;
> > 
> >   options [0] = "/usr/bin/gcc";
> >   options [1] = "-v";
> >   options [2] = NULL;
> 
> You're expecting this to work? ;-).
> 
> gchar *options[3];
> options[0] = "/usr/bin/gcc";
> options[1] = "-v";
> options[2] = NULL;
> 
> You're accessing a pointer as if it were allocated,
> but it isn't.
> 
> > When I launch it, program crash with a "seg
> fault". This is strace output:
> 
> Try to use a debugger such as gdb.
> 
> Ronald
> 
> -- 
> Ronald Bultje <[EMAIL PROTECTED]>
> Linux Video/Multimedia developer
> 
> _______________________________________________
> gtk-list mailing list
> [EMAIL PROTECTED]
> http://mail.gnome.org/mailman/listinfo/gtk-list 

_________________________________________________________
Do You Yahoo!? 
雅虎通网络KTV, 随时随地免费卡拉OK~~
http://rd.yahoo.com/mail_cn/tag/?http://cn.messenger.yahoo.com//chat/index.html
_______________________________________________
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list

Reply via email to