Weird Struct Stuff

Started by
1 comment, last by Agent1 23 years, 10 months ago
        
// 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
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.
==========================================In a team, you either lead, follow or GET OUT OF THE WAY.
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
- DarkMage139

This topic is closed to new replies.

Advertisement