Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AbrahamR), 717 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 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