I am having a set of number and its corresponding strings
1 -> Shutdown
2 -> Hibernet
3 -> Sleep
4 -> Restart
5 -> Lock
This list can go bigger number mapping to strings
I am curios to know any way we can achieve this by Using C Program, I think if could e easy by map in object oriented C# , C++. I believe it would be difficult to put #define
.
The input is integer and returns the corresponding string value. It Would be great help if we can make it very efficient as we may run into this muliple times.