Computer Chess Club Archives


Search

Terms

Messages

Subject: C question (enum)

Author: Robert Pope

Date: 10:18:12 11/15/01


I was looking at crafty's chess.h, and noticed that Bob uses a typedef when
creating enums:

typedef enum {none=0, pawn=1, knight=2,
        king=3, bishop=5, rook=6, queen=7} PIECE;

My program, still in the early stages, does it without, and seems fine so far:

enum pieces {none=0, pawn=1, knight=2, bishop=3,
             rook=4, queen=5, king=6};

Are these declarations equivalent, are they different structures for different
purposes, or is mine just waiting to blow up in my face once I move on to other
sections?

Thanks,
Rob



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.