Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,388 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 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 | 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