Yes, it's possible. It would be something like this...
int multiplier = /* multiply by 10, 100, 1000, whatever based on the number of digits in b */
int combine = (multiplier * a) + b;
Your job is to figure out how many digits b has. There are a few ways to do that. log10 and pow from cmath might help, and / or use the / and % operators in a loop to figure it out or write your own helper function(s). Or perhaps use the itoa function if available or the snprintf(or sprintf if you're careful) function to turn b into a string, then take the length of that string.