How to concatenate two integers in C

后端 未结 9 1301
执念已碎
执念已碎 2020-11-29 11:27

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

9条回答
  •  南笙
    南笙 (楼主)
    2020-11-29 11:55

    You can also use Macro to concatnate Strings ( Easy way )

    #include
    #define change(a,b) a##b
    int main()
     {
        int y;
        y=change(12,34);
        printf("%d",y);
        return 0;
     }
    

    It has one Disadvantage. We can't pass arguments in this method

提交回复
热议问题