Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1109281
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T02:12:32+00:00 2026-05-17T02:12:32+00:00

I had code that looked like this: enum EEventID { eEvent1, eEvent2, … eEventN

  • 0

I had code that looked like this:

enum EEventID {
  eEvent1,
  eEvent2,
  ...
  eEventN };

And that got reviewed and changed to

typedef enum {
  eEvent1,
  eEvent2,
  ...
  eEventN } EEventID;

What is the difference between the two? Why make the change? When I looked at this question, the only mention of typedefs got downvoted.

  • 1 1 Answer
  • 3 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T02:12:33+00:00Added an answer on May 17, 2026 at 2:12 am

    The two are identical in C++, but they’re not the same in C — in C if you use the typedef you get code that is compatible between C and C++ (so can be used freely in a header file that might be used for either C or C++). That’s the only reason I can see for preferring it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I had a bit of conditional code that looked like this: if self.above and
I had some code that looked like this: List<ListBoxItem> items = ( from String
A co-worker asked about some code like this that originally had templates in it.
I had some fortran code that looked something like: subroutine foo(mx,my,mz) real pts(3,mx,my,mz) end
I have just refactored a colleague's code that, roughly, looked like this... public class
I had this working in an old code that I didn’t end up using...
I've had trouble writing this code. I'm supposed to make a function that can
I just had a pretty painful troubleshooting experience in troubleshooting some code that looked
I had code that worked fine when running in the context of the main
I had some code that constructed an object: function gridObjConst(id, itemName, itemPrice, itemListPrice, width,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.