Official Forum for Programming in Objective-C (the iPhone Programming Language) - Stephen Kochan
August 16, 2017, 08:28:17 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register Chat  
Pages: [1]   Go Down
  Print  
Author Topic: enum & typedef question  (Read 1679 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:  

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 ゥ 2009 classroomM.com. All rights reserved.