K
KorbohneD
Guest
Quick Question Guys.
In my current project I have written a text file translator that turns text file code into real code.
Now the problem is, in the program, I have a bunch of enums, one in particular describing material. And of course I want to tell the textfile, which material it should give to the translator.
Is there any way to translate a string into an enum code?
Like I have this code here:
Something like above?
I am really clueless what to do.
Any help is appreciated.
Sincerely,
KorbohneD
In my current project I have written a text file translator that turns text file code into real code.
Now the problem is, in the program, I have a bunch of enums, one in particular describing material. And of course I want to tell the textfile, which material it should give to the translator.
Is there any way to translate a string into an enum code?
Like I have this code here:
Code:
enum material {
stone;
wood;
iron
}
textfile_variable = stone;
material_to_use = material.textfile_variable
I am really clueless what to do.
Any help is appreciated.
Sincerely,
KorbohneD