+ 1

How can i store both int and char in c++ array or change input to int to save time

Hi ... so i was able to figured a way to solve a sudoku challenge 9×9 which was easy .. 16×16 and 25×25 but with base 10 number only...but the marker wants the numbers in base 16 to 25 im struggling to find a way like even the inputs will be given in base 16 .. by base 16 i mean A -10 ;B-11 ... and i declared my array as int so i get an error if i put A in my array...

4th Sep 2020, 12:46 PM
Mr database
Mr database - avatar
3 ответов
+ 2
I didnt get your question, but if my understanding is clear then You can type cast it to int. int x = (int)('a')
4th Sep 2020, 1:05 PM
Charitra
Charitra - avatar
+ 1
@Charitra i meant like int grid = {{0 ,1,2,3,4,4,A,3,5, till 16 }; { B ,2,4,4,2,A,2,3 till}}; how can i declared a metrix that will hold such datatypes
4th Sep 2020, 1:14 PM
Mr database
Mr database - avatar
+ 1
Thanks
4th Sep 2020, 1:14 PM
Mr database
Mr database - avatar