c++ - What might be ideal way to make certain char[] arrays map to certain integers? -
i had no idea how search question, or word really, on more vague scale or otherwise. anyway...
as stands have rudimentary char array max size of 100; set way reading 1 character @ time file (also necessary) , length maxed out @ 100 well.
anyway, need switch between multiple different cases of exact char arrays (essentially equating char arrays integers) , i'm having difficulty determining way newbie. since doing lookup based on content of char array, tried unorganized map, mapping contents of char array (as key) integer, gave me type error (char[] doesn't work parameter , char* , such don't work), might because don't know appropriate syntax be, whatever.
then figured convert string , way, converting char array string put table equated integer intuitively sounds moronic, , converting char array string seems surprising amount of hassle.
i figured set switch or bunch of else ifs check char array's contents , set integer, google-fu failing me on syntax of well, , seems kind of silly given using switch doesn't seem work either. char arrays seem more hassle they're worth...
in end, figured best shot ask smart folks rather bumbling upon idiotic solution myself. ye?
Comments
Post a Comment