Newbie question



I would like the opinions of the experts here, hopefully in agreement.

I've developed the bones of an application with a C backend and a Gtk
front end (NB gtk compiles with the -ansi switch and so is legitimate to
mention in this forum). I've not been able to get them to talk directly
to each other in a reliable manner, so I've set it up for them to use
the same data base to pass stuff back and forth.

What I've done is declare a struct in a header file, which is included
in the files for both ends. For example:

-------
/* --- data.h --- */
struct data {
char question[80];
char answer[80];
} calc[80];
-------

This works fine. My question is this: Is this legal and conforming?

I get from K&R2, page 82, that functions can indeed be declared in
header files. Do I understand this correctly?

Because if I do, then I'm ready to start building this application
keeping the C and the Gtk completely separate. And I sure don't want to
start this project on the basis of UB or IDB.

Thanks all,

Longfellow



.