Amazon.com Widgets enum & typedef question
Welcome, Guest. Please login or register.
Did you miss your activation email?
April 25, 2014, 02:11:20 AM
Home Help Search chat Login Register 
News: Read this please.The Great Kangaroo Escape Looking for reviews of the 4th ed on Amazon!   Twitter:  @skochan
                     

+ Official Forum for Programming in Objective-C (the iPhone Programming Language) - Stephen Kochan
|-+ Programming in Objective-C, 4th edition
| |-+ Chapter 10
| | |-+ enum & typedef question
Pages: [1] Go Down
Print
Author Topic: enum & typedef question (Read 871 times)
Hesadanza
Newbie
*
Posts: 28






on: February 11, 2012, 06:01:02 PM

What is the difference between these two blocks:
Code: (Objective-C)
enum Direction {east, west, south, north};
enum Direction step1, step2;
step1 = east;

And this:

Code: (Objective-C)
typedef enum {east, west, south, north} Direction;
Direction step1, step2;
step1 = east;

What's the difference?  Or are they equivalent?
Logged
skochan
Administrator
Hero Member
*****
Posts: 3114







Reply #1 on: February 22, 2012, 10:41:20 AM

They're equivalent as far as what they do.

Cheers,

Steve
Logged
Pages: [1] Go Up
Print
Jump to:



Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Entire forum contents (c) 2009 classroomM.com. All rights reserved.