Gamestudio Links
Zorro Links
Newest Posts
Zorro version 3.0 prerelease!
by TipmyPip. 02/20/26 13:22
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 02/19/26 13:22
Camera always moves upwards?
by VoroneTZ. 02/19/26 13:13
Hedge on FXCM, 4 or 5?
by Martin_HH. 02/16/26 16:09
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
3 registered members (TipmyPip, Quad, AndrewAMD), 10,074 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
alx, ApprenticeInMuc, PatrickH90, USER0328, Sfrdragon
19199 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