answersLogoWhite

0

Its very Simple that using Enumerated data type you are making special integers that flow within range, While a typedef is redefining data type with new name. Example: like defining enum Days{sun,mon,tue.....} makes an integer definition that can have 0-7 values So if u do following: Days x=sun; or Days x=0; then x=x+2; is 2 or tue and x=x+7; is 0 or sun again... Means its modulo 7 data type ................. While doing this: typedef Days WeekDays; renames Days as WeekDays Similary typedef int NUMBER; renames int as NUMBER .But wait it is one more name for the data type.. So simply enum creates a numeral modular datatype with a range while typedef creates another name for it. Rupesh K Joshi

User Avatar

Wiki User

19y ago

What else can I help you with?

Related Questions

What is the difference between a macro and typedef?

A Macro is a preprocessor directive means that before compilation the macros are replaced. Where as typedef is defining a new data type which is same as the existing data type. Syntax: typedef Existing datatype New datatype For example typedef int NUMBER; Here NUMBER (New datatype)is defined as a data type which contains the properties same as int(Existing datatype). You can declare a variable of int as NUMBER a; is same as int a; similarly typedef int* NUMBERPOINTER; NUMBERPOINTER a; Here a is a pointer of integer type.


What is the difference between Typedef and Reference in C plus plus?

A typedef is a compiler macro. A reference is a pointer, usually implemented with transparent syntax. They have no relationship between each other.


How do you declare data types?

typedef data_type data_name, for instance:typedef int myDataType;


What is the difference between Typecast and Typedef?

Typecasting is to make a variable of one type, act like another type for one single operation. Type-def is to assign alternative names to existing types.


Typedef int a a a Is this possible in C?

No, but 'typedef int a;' is possible, it defines the type 'a'.


What are the Uses of typedef?

the purpose of typedef is to redefine the name of an existing variable type. e.g. typedef unsigned long int T; T v1,v2;


What is the use of type def in c?

A typedef is used to define a type. The clue is in the name: typedef = type definition.


How do we represent typedef in enterprise architect tool?

create class with typedef construct.and then add the base class with the name type


How is typedef different from int in c language?

They are entirely different things; int is a type, typedef is a way to define types.


Use of typedef?

You use typedef to give a different name to a current data type. Consider the following: typedef int integer; Now everytime you do "integer x", it'll be an int. Basically, there is no case where you _must_ use it, only cases where it might be easier to have typedefs.


What is meant by the storage class of a variable?

auto, extern, static, register, typedef (only formally)


What is the use of typedef?

The purpose of typedef is to assign alternative names to existing types, most often those whose standard declaration is cumbersome, potentially confusing, or likely to vary from one implementation to another

Trending Questions
What should be done after a stress cone is installed on a high voltage conductor termination? What are 3 types of opposition to current flow that impedance represents? Should you pour a concrete sidewalk without crushed stone? Can any one of you please suggest which materials are to be prepared for basic mechanical engineering? What are the common errors in shell scripting associated with for loop? What are the various turning operations that can be performed and the shapes and types of tooling that can be used (such as solid speed tooling? What is the difference between P and BR tag? How much voltage does a battery produce? How do you change font size default in tvs msp 250 star printer? Who is the real frank barnes engineer? When a multi dimensional array is passed to a function how are formal argument declaration written? Name different ways of joining metals? How can you tell if a pipe fitting is cast or ductile iron? What can be used to reduce the amount of voltage drop across the branches of a parallel circuit to be less than source voltage? Some technologies like vertical farming have a number of negative effects Which is a negative outcome of this technology? Why won't lotro load? What is meant by open circuit voltage and arc voltage? What is the importance of water supply system? What are the effect of over tightening the compression fitting? If resistor X has the same length and is made of the same material as resistor Y but has twice the diameter. Resistor X has the blank resistance of resistor Y?