1 Dec 2000 duncanm   » (Master)


Oh... did I say I love Montreal? Anyhow... a lot of college application work to be done now. Lots of other school work too, as the semester is slowly coming to an end.


I have a quiz/test tomorrow on structs, it shouldn't be too bad.

Sidenote: from what i understand of structs in C (well, my class teaches C++ with the AP classes)

struct FOO { int bar; int baz };

would create a struct 'handler' named FOO that has two int elements... from that onwards, if you want a FOO struct, you do:

FOO x = {1,2};
and x will be initialized such that x.bar is 1 and x.baz is 2.

so, why in a lot of GNOME code and other code, do i see this:

typedef struct {
	int bar;
	int baz;
} FOO;
so that the struct has no 'handler' at all, and only typedef'd into a type? what's the difference between doing this and just naming the struct with a handler?

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!