• Advertisement

Archived

This topic is now archived and is closed to further replies.

Weird Struct Stuff

This topic is 6451 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

        
// Variable names have been changed to protect the innocent :D

struct nums{
	int bleghone;
	int bleghtwo;
	int bleghthree;};

typedef struct nums BLEGHTYPE;
BLEGHTYPE lala;
BLEGHTYPE test;
lala.bleghone = 5;
lala.bleghtwo = 6;
lala.bleghthree = 6;
        
This code give me errors like: "syntax error : missing ';' before '.'" "'lala' : missing storage-class or type specifiers" "'lala' : redefinition; different basic types" Etc. This is the first time this has happened to me with structs... am I missing something?

-Agent1

Visit Activeworlds today!
Edited by - Agent1 on 6/24/00 7:32:34 PM

Share this post


Link to post
Share on other sites
Advertisement
Don''t see any problem with your code there. Maybe you should try this

    
typedef struct nums{
int bleghone;
int bleghtwo;
int bleghthree;
}BLEGHTYPE;


It might work now.

Share this post


Link to post
Share on other sites
Using a pointer might work. Like:

        
typedef struct{
int bleghone;
int bleghtwo;
int bleghthree;
} BLEGHTYPE, *p_lala;

p_lala->bleghone = 5;



At least that's how I always do it.

- DarkMage139
"Real game developers don't change the rules. Real game developers don't break the rules. Real game developers make the rules!"
"Originality (in games) is the spice of life!"

Edited by - DarkMage139 on June 25, 2000 9:15:49 AM

Share this post


Link to post
Share on other sites

  • Advertisement