Qbasicnews.com
April 26, 2018, 09:35:51 PM
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
:
Back to Qbasicnews.com
|
QB Online Help
|
FAQ
|
Chat
|
All Basic Code
|
QB Knowledge Base
Home
Help
Search
Login
Register
Qbasicnews.com
>
General
>
General/Misc
>
General Programming
>
GCC help
Pages: [
1
]
« previous
next »
Print
Author
Topic: GCC help (Read 5813 times)
wallace
Wandering Guru
Posts: 368
GCC help
«
on:
November 29, 2006, 07:28:30 PM »
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?
Logged
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.
thegrogen
Ancient QBer
Posts: 444
GCC help
«
Reply #1 on:
November 30, 2006, 12:08:51 AM »
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.
Logged
.14159265358979323846264338327950288419716939937510582709445
Glarplesnarkleflibbertygibbertygarbethparkentalelelangathaffendoinkadonkeydingdonkaspamahedron.
wallace
Wandering Guru
Posts: 368
GCC help
«
Reply #2 on:
November 30, 2006, 12:04:36 PM »
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?
Logged
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.
Zap
Been there, done that
Posts: 1124
GCC help
«
Reply #3 on:
November 30, 2006, 12:32:14 PM »
Have you tried just doing this:
Code:
typedef struct cache{
int size;
int blocksize;
cache *subcache;
} cache;
?
It works for me anyway.
Logged
url=http://www.copy-pasta.com]CopyPasta[/url] -
FilePasta
wallace
Wandering Guru
Posts: 368
GCC help
«
Reply #4 on:
November 30, 2006, 12:41:50 PM »
Yeah, I tried that, I got a parse error, same as the one with the underscore.
Logged
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.
shiftLynx
Wandering Guru
Posts: 340
GCC help
«
Reply #5 on:
November 30, 2006, 01:06:19 PM »
Code:
typedef struct cache_st
{
int size;
int blocksize;
struct cache_st* subcache;
} cache_t;
Logged
img]http://www.cdsoft.co.uk/misc/shiftlynx.png[/img]
wallace
Wandering Guru
Posts: 368
GCC help
«
Reply #6 on:
November 30, 2006, 04:28:04 PM »
That's it.
Thanks.
Logged
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.
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
QbasicNews.Com
-----------------------------
=> QB/FB News
=> Site/Forum Issues
=> Challenges
-----------------------------
QBasic
-----------------------------
=> QB Discussion & Programming Help
=> QB Projects
-----------------------------
Qbasic "like" compilers/interpreters
-----------------------------
=> General QB "like"
=> QB64
=> FB Discussion & Programming Help
===> FB Projects
===> FB Documentation
-----------------------------
General
-----------------------------
=> General/Misc
===> Art & Music
===> General Programming
Loading...