The first number is the dimension of my problem and the second number is another factor which I need to get for future calculation. I don't know how the get any arbitrary digit out of an enum datatype. I tried to convert enum to string and then get the second digit of string using stringify. by the way I want to get any digit of enum without converting to string. can anyone help me with this.
thanks in advance.
Thanks for your answer. I'm looking for something just for example take D2Q9 and return the dimension=2 and number node=9. I thought about first option before but you need to repeat it twice to get dimension and node. maybe I can use pair for the fist option.
basically you are asking for a variable name via code.
you don't normally do this:
cout << //what now, I want to peel the number 12 from the variable name here, how?
you can do this via preprocessor macros, but its a horrible solution and usually an indication of a bad idea.
instead, consider a map or similar structure that ties the name as a string and the value together.