6 Feb 2012 cdfrey   » (Journeyer)

fzort: I'm not a guru, but the ? operator needs the same type on both sides of the colon, whereas the multiple return statements can handle each type separately and convert to the base foo. Try:

struct foo { };
struct bar : foo { };
struct baz : foo { };

foo *doit(bool which)
return which ? (foo*) new bar : (foo*) new baz;

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!