Posts: 357
Threads: 118
Joined: Oct 2004
Is there a way to have a struct hold an pointer to an instance of itself?
Code:
typedef struct{
int size;
int blocksize;
cache *subcache;
} cache;
I know that this code doesn't work, is there a trick to doing it somehow?
f you play a Microsoft CD backwards you can hear demonic voices. The scary part is that if you play it forwards it installs Windows.
Posts: 320
Threads: 24
Joined: Feb 2005
Code:
typedef struct _cache{
int size;
int blocksize;
cache *subcache;
} cache;
Try that. If it doesn't work, it's because I've been coding deprived for a while.
.14159265358979323846264338327950288419716939937510582709445
Glarplesnarkleflibbertygibbertygarbethparkentalelelangathaffendoinkadonkeydingdonkaspamahedron.
Posts: 357
Threads: 118
Joined: Oct 2004
Looks like you're code deprived, it doesn't work :b
It's ok, I used to be good at C too, anyone else got an idea?
f you play a Microsoft CD backwards you can hear demonic voices. The scary part is that if you play it forwards it installs Windows.
Posts: 838
Threads: 17
Joined: Jan 2002
Have you tried just doing this:
Code:
typedef struct cache{
int size;
int blocksize;
cache *subcache;
} cache;
?
It works for me anyway.
url=http://www.copy-pasta.com]CopyPasta[/url] -
FilePasta
Posts: 357
Threads: 118
Joined: Oct 2004
Yeah, I tried that, I got a parse error, same as the one with the underscore.
f you play a Microsoft CD backwards you can hear demonic voices. The scary part is that if you play it forwards it installs Windows.
Posts: 320
Threads: 9
Joined: Dec 2004
Code:
typedef struct cache_st
{
int size;
int blocksize;
struct cache_st* subcache;
} cache_t;
img]http://www.cdsoft.co.uk/misc/shiftlynx.png[/img]
Posts: 357
Threads: 118
Joined: Oct 2004
That's it.
Thanks.
f you play a Microsoft CD backwards you can hear demonic voices. The scary part is that if you play it forwards it installs Windows.