Hello,

I recently ventured down the cmd/cc/ sources. And what did I discover ?
Take a peek of the following (sorry ass of an -) example and see yourself.

#include <u.h>
#include <libc.h>

struct Foo {
        int x,y;
};

typestr struct Foo Foo;

Foo Foo_add_(Foo a,Foo b)
{
        return (Foo){a.x+b.x, a.y+b.y};
}

void main(void)
{
        Foo f1 = {1,1},f2 = {2,2},f3;
        f3 = f1 + f2;

        print("%d,%d\n",f3.x,f3.y);   
        exits(nil);
}

Neat, no ?

Any particular reason this isn't documented ?

--
Nils O. SelÃsdal

Reply via email to