Stack Overflow has this question answered in many other languages, but not C. So I thought I\'d ask, since I have the same issue.
How does one concatenate t
z = x * pow(10, log10(y)+1) + y;
Explanation:
First you get the number of digits of the variable that should come second:
int digits = log10(y)+1; // will be 2 in your example
Then you "shift" the other variable by multiplying it with 10^digits.
int shifted = x * pow(10, digits); // will be 1100 in your example
Finally you add the second variable:
z = shifted + y; // 1111
Or in one line:
z = x * pow(10, (int)log10(y)+1) + y;