Y
yogi_bear_79
I have a char *year that contains a 4-digit year (i.e 1929), I use the
following syntax c = atoi(year); to convert it to an integer. However
I must strip the first two numbers. I've tried to convert it from
char* to a string and use the erase function, which works, but then I
can't seem to convert the string it to an integer. I am impartial as
to when I remove the first two digits, meaning it can be done before
or after the conversion to int. In my example above the end result
should be an integer variable equalling 29.
following syntax c = atoi(year); to convert it to an integer. However
I must strip the first two numbers. I've tried to convert it from
char* to a string and use the erase function, which works, but then I
can't seem to convert the string it to an integer. I am impartial as
to when I remove the first two digits, meaning it can be done before
or after the conversion to int. In my example above the end result
should be an integer variable equalling 29.