Re: [LAD] [ot] programming typedefs...

From: Fons Adriaensen <fons@email-addr-hidden>
Date: Thu Jul 10 2008 - 19:43:00 EEST

On Thu, Jul 10, 2008 at 06:24:29PM +0200, Julien Claassen wrote:

> But I'mtoo stupid. I have a struct, which contains a pointer to itself as an
> element. How to write this. I once knew, but now I fail. It's a shame! :-(

This works for me:

#include <stdio.h>

struct XXX
{
    int a;
    int b;
    struct XXX *p;
};

int main (void)
{
    struct XXX X;

    X.p = &X;

    printf ("%p, %p\n", &X, X.p);

    return 0;
}

-- 
FA
Laboratorio di Acustica ed Elettroacustica
Parma, Italia
O tu, che porte, correndo si ?
E guerra e morte !
_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev
Received on Thu Jul 10 20:15:05 2008

This archive was generated by hypermail 2.1.8 : Thu Jul 10 2008 - 20:15:05 EEST