Gamestudio Links
Zorro Links
Newest Posts
zorro license, IB connection
by AndrewAMD. 12/06/23 17:16
Newbie Questions
by fairtrader. 12/06/23 11:29
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
5 registered members (AndrewAMD, miwok, TipmyPip, 3run, 1 invisible), 636 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
struct's struct? #368995
04/30/11 10:56
04/30/11 10:56
Joined: Jan 2011
Posts: 122
GUILIN , CHINA
tzw Offline OP
Member
tzw  Offline OP
Member

Joined: Jan 2011
Posts: 122
GUILIN , CHINA
hi,everybody. a question make me confused? is a struct can directly have a member struct.i mean DO NOT use a pointer. someone can tell me about it?


Full of my eyes are class struggles.....
Re: struct's struct? [Re: tzw] #368999
04/30/11 11:19
04/30/11 11:19
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline
Senior Expert
HeelX  Offline
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
Yes, why not? It would be cooler, if you would test it out by yourself, but I don't mind doing that for you:

Code:
typedef struct
{
   int a, b;
   float c;
   STRING* d;
} STRUCT_A;

typedef struct
{
   int e, f;
   BMAP* h;
   
   STRUCT_A aaa, bbb;
} STRUCT_B;

void main ()
{
   STRUCT_B test;
   test.aaa.a = 10;
   test.bbb.b = 2;
   test.aaa.a *= test.bbb.b;

   // works
   printf("test.aaa.a = %d", test.aaa.a);
}



Have fun!

Last edited by HeelX; 04/30/11 11:19.
Re: struct's struct? [Re: HeelX] #369000
04/30/11 11:33
04/30/11 11:33
Joined: Jan 2011
Posts: 122
GUILIN , CHINA
tzw Offline OP
Member
tzw  Offline OP
Member

Joined: Jan 2011
Posts: 122
GUILIN , CHINA
thanks you!!


Full of my eyes are class struggles.....

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1