passing string[] to C
Charles D Hixson
charleshixsn at earthlink.net
Wed Apr 2 14:50:34 PDT 2008
Charles D Hixson wrote:
> I hope this is trivial, but I haven't been able to figure out how I'm
It was trivial. Once I imported the correct header file into
the C code, things started working. (Well...producing useful
error messages.)
> Here's my corrected trial (severely edited.):
>
> The C routine:
> #include <stdlib.h>
> #include <stdio.h>
#include <gtk/gtk.h>
>
> int cGtkInit (int argc, char** argv)
...
> printf (".3-------------------------------....\n");
//> gtk_init (argc, argv);
gtk_init (&argc, &argv);
> printf ("cGtkInit after initialization\n");
> return 1;
> }
>
> Yielding at execution time:
Hello World!
screen variable declared.
next step is C
cGtkInit before initialization
char*[1] argv =
.1......................................
argv [0] : './scribble'
.2......................................
argv [0] : "./scribble"
.3-------------------------------....
cGtkInit after initialization
screen variable initialized.
Screen initialized
in routine amain
gtk_init (&argc, &argv);
More information about the Digitalmars-d-learn
mailing list