Tip:
Highlight text to annotate it
X
In this tutorial , we are going to discuss about #define , typedef and enum .
#define is used for creating constants in c . It is only way for creating constants in c .
#define is used to create a alias for a constant ex : #define printf pf you can write # define inside the functions also
typedef is used to create an alias for existing datatype .
ex : int I char C
typedef struct class node Here node is an alias for struct node
enum is a user-defined data type with your set of values as range . By default , the first constant in the enum is 0 and remaining constants are assigned with the values sequentially from 0 or user assigned value to the first constant
sorry in the audio . I said variables in the enum are assigned sequentially , but it is not variables it is constants