How to get element type in C++?
c++, char, indexing, string
Solution
The type for any element in a char array will always be char. You can, however, check if the char is a digit with isdigit(ch).
Problem
I am a beginner at programming in C++, I would like to ask you, what is the algorithm/ way to see what kind of element is the following in a char / string. For example, if I have ``` char b[]="Ab 3"; ``` and the index, let's say "i" is ``` i=2; ``` this means that on i=3 there is '3'. My question: Does there exist an algorithm, which tells me, if I am on index 2, what type of element is on index 3? In our case an 'int'. Thank you very much!