How to passing enum in typedef as a float?

Issue

This Content is from Stack Overflow. Question asked by Raza Ali

I am trying to add float values in enum typedef as given below:

enum PRIORITYTYPE {
        0.1
        0.2
        0.3
        0.4
        0.5
        0.6
        0.7
        0.8
        0.9
        1.0
    }

But I getting error. How to solve this issue by checking fixed values and place it in typedef? whereas string working proper when I enter sting as given but not float nor int

enum FREQUENCYTYPE {
        Daily
        Weekly
        Monthly
        Yearly
    }



Solution

This question is not yet answered, be the first one who answer using the comment. Later the confirmed answer will be published as the solution.

This Question and Answer are collected from stackoverflow and tested by JTuto community, is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?