c - How to merge array elements with token merging ## operator??? -


i want merge 3, 7, 1 371. want know how merge it???

#include <stdio.h> int main(void)  { int a[] ={3, 7, 1}; return(0); }  

you try this;

#include <stdio.h> int main(void)  {     int a[] ={3, 7, 1};     int i, result = 0;      for(i=0;i<sizeof(a)/sizeof(a[0]);i++)         result += a[i] * pow(10, sizeof(a)/sizeof(a[0])-i-1);      printf("result %d\n", result);     return(0); }  

Comments

Popular posts from this blog

cookies - Yii2 Advanced - Share session between frontend and mainsite (duplicate of frontend for www) -

angular - password and confirm password field validation angular2 reactive forms -

php - Permission denied. Laravel linux server -