Gamestudio Links
Zorro Links
Newest Posts
MinMax function on History t6 file
by LucasJoshua. 11/21/26 14:28
What are you working on?
by rayp. 11/20/26 18:10
FXCM => AVA Trade Plugin???
by Martin_HH. 11/17/26 17:02
contractUpdate() is filtering if >2 rows
by mistery. 11/09/26 12:06
New Zorro version 3.15
by jcl. 11/09/26 09:24
Removing outliers from files
by jcl. 11/04/26 10:30
[MED] Import from FBX (2010) missing!!!
by rayp. 11/03/26 14:33
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
2 registered members (LucasJoshua, 1 invisible), 41,382 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EvanTJ, rht, MaliceTheMaker, Haitao_Ren, JimSimons
19250 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Global and local struct #111293
02/07/07 15:20
02/07/07 15:20
Joined: Aug 2005
Posts: 1,558
HK
V
vlau Offline OP
Serious User
vlau  Offline OP
Serious User
V

Joined: Aug 2005
Posts: 1,558
HK
Code:

struct SPOT { // defines a global struct type named "SPOT"
int x;
int y;
char name[10];
};
struct SPOT myspot;

function main()
{
video_mode = 7;
screen_color.blue = 1;

// Define a local struct
struct SPOT {
int x;
int y;
char name[10];
};
struct SPOT myspot;

myspot.x = 10; // **
myspot.y = 20; // **
}



In the above code, I've defined 2 structs with the same name,
one is global struct and the other is local struct, and it
compiles and run without problem. I can access the local struct
members with the line //** but is there anyway to access the global
struct members? If not, why not throw a warning message?

Thanks.

Re: Global and local struct [Re: vlau] #111294
02/07/07 15:56
02/07/07 15:56
Joined: Nov 2003
Posts: 108
Oklahoma, USA
FixxeR Offline
Member
FixxeR  Offline
Member

Joined: Nov 2003
Posts: 108
Oklahoma, USA
Unless I'm very much mistaken, there is no such thing as a local struct.

FixxeR


John Dies at the End - One of the best fictional stories online. Join the fight for Internet Freedom
Re: Global and local struct [Re: FixxeR] #111295
02/07/07 16:12
02/07/07 16:12
Joined: Sep 2003
Posts: 407
inside to my
er_willy Offline
Senior Member
er_willy  Offline
Senior Member

Joined: Sep 2003
Posts: 407
inside to my
I think equal. For the compiler is the same struc.

Re: Global and local struct [Re: er_willy] #111296
02/07/07 17:00
02/07/07 17:00
Joined: Aug 2005
Posts: 1,558
HK
V
vlau Offline OP
Serious User
vlau  Offline OP
Serious User
V

Joined: Aug 2005
Posts: 1,558
HK
Oh, maybe I'm doing a stupid thing.
Thank you both.


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