Essentially I have a line which ends in two numbers. I can read the numbers eg) '4' and '1'. I want to concatenate them into '41' and then read that as an int type of value 41. Converting a single character to int is straight forward but how would this work for two (or more) characters?
I am grabbing the characters using:
int first_digit = ctoi(line[1]);
int second_digit = ctoi(line[2]);
where ctoi is defined as :
int ctoi( int c ) // https://stackoverflow.com/a/2279401/12229659
{
return c - '0';
}