C Code Formatting Demo 3


FormatCode Code Formatter is based on serveral powerful syntax parser engines so you can exactly control the appearance of your source code. Here is the code formatting demo of FormatCode C Code Formatter to prove the ability of code formatting functions of FormatCode:

   /* Before Code Formatting */

   char a[80];
   int e[4],g[5],c=100,h,i,j,k,b,f,s,t,p[4][1000];
   int main(char*d){
   return main((char*)(srand(time(&h)),
   setjmp(p[2]),
   (k=atoi((gets(a),
   a+strspn(a," -"))))
   &&(b=k),
   b||++b,
   j+=-j,
   d=(char*)(&j),
   setjmp(p[1]),
   1<<1>j&&(k&=4>>3,
   i=1<<k,
   h<<=i+j,
   setjmp(p[0]),
   (h+=*d++-h)&&(-'1'^(h-='1'))&&(i<<=4,
   setjmp(p[3]),
   (i||!++i)&&(h--||(k|=i),
   i/=2,
   longjmp(p[3])),
   longjmp(p[0])),
   k^=-1,
   k+=1<<037,
   setjmp(p[3]),
   k&&((--i<5&&1&k)&&(s=(rand()>>9)%0x4,
   setjmp(p[0]),
   t+=(rand()>>3)%015-t,
   e[s]&(1<<t)&&longjmp(p[0]),
   e[s]|=1<<t,
   g[i]=t|++s<<"\004"["\004"[1]]|t),
   k>>=1,
   i+=1<<1,
   longjmp(p[3])),
   setjmp(p[0]),
   putchar(0x20+!putchar(012+"(.7-A,G+@*J)/"[(017&(i=g[4-k]))*013%13])),
   ++k^005&&longjmp(p[0]),
   putchar('\n'),
   setjmp(p[3]),
   putchar(0x1F+!!putchar(("BCDHS"[g[--k]>>4]))),
   k&&longjmp(p[3]),
   putchar('\n'),
   j+=1<<0,
   1^j||(d=(char*)gets(a)),
   longjmp(p[1])),
   s=1==(f=0),
   i=0<<1,
   setjmp(p[3]),
   i<4&&(j=i+1,
   setjmp(p[1]),
   j<5&&((017&g[j])>(g[i]&15)&&(k=g[i],
   g[i]=g[j],
   g[j]=k),
   j++,
   longjmp(p[1])),
   i++,
   longjmp(p[3])),
   setjmp(p[0]),
   i--&&!((g[1+i]^g[i])>>4)&&longjmp(p[0]),
   setjmp(p[1]),
   --j&&(!(k=(g[j]&15)-(g[j-1]&017)+1)||(!(j-1)&&(8==-k)))&&longjmp(p[1]),
   s+=3*!j|!(++i^17),
   (j*=i*=4)&&(i=1),
   setjmp(p[3]),
   5-j<2&&(j=0,
   setjmp(p[1]),
   5-i>j&&((g[j]^g[j+1])&0xf?g[j]^=g[j]:(s+=((g[j]&0xf)>8&&f++,
   !!g[j]*i)),
   j++,
   longjmp(p[1])),
   i++,
   longjmp(p[3])),
   s=1^s?"AACEDJQZHello World"[s]-'A':!!f,
   s+=(!i)*(6+12*s-!!s*(g[2]&017^0xa?8:-192)),
   s--,
   s*=b,
   printf("$%d (%d) \n",
   c+=s,
   s+b),
   i=0,
   setjmp(p[0]),
   6>i&&(j=1,
   setjmp(p[1]),
   0<=j&&(e[i+j]^=*(i-j+e+(j<<1)),
   --j,
   longjmp(p[1])),
   i+=++i,
   longjmp(p[0])),
   longjmp(p[2])));
   }


   /* After Code Formatting */

   char a[80];
   int e[4], g[5], c = 100, h, i, j, k, b, f, s, t, p[4][1000];
   int main(char *d)
   {
     return main((char*)(srand(time(&h)), setjmp(p[2]), (k = atoi((gets(a), a +
                 strspn(a, " -")))) && (b = k), b || ++b, j +=  - j, d = (char*)
                 (&j), setjmp(p[1]), 1 << 1 > j && (k &= 4 >> 3, i = 1 << k, h <<=
                 i + j, setjmp(p[0]), (h +=  *d++ - h) && ( - '1' ^ (h -= '1')) &&
                 (i <<= 4, setjmp(p[3]), (i || !++i) && (h-- || (k |= i), i /= 2,
                 longjmp(p[3])), longjmp(p[0])), k ^=  - 1, k += 1 << 037, setjmp
                 (p[3]), k && ((--i < 5 && 1 &k) && (s = (rand() >> 9) % 0x4,
                 setjmp(p[0]), t += (rand() >> 3) % 015-t, e[s] &(1 << t) &&
                 longjmp(p[0]), e[s] |= 1 << t, g[i] = t | ++s <<
                 "\004"["\004"[1]] | t), k >>= 1, i += 1 << 1, longjmp(p[3])),
                 setjmp(p[0]), putchar(0x20 + !putchar(012+"(.7-A,G+@*J)/"[(017 &
                 (i = g[4-k])) *013 % 13])), ++k ^ 005 && longjmp(p[0]), putchar
                 ('\n'), setjmp(p[3]), putchar(0x1F + !!putchar(("BCDHS"[g[--k] >>
                 4]))), k && longjmp(p[3]), putchar('\n'), j += 1 << 0, 1 ^ j ||
                 (d = (char*)gets(a)), longjmp(p[1])), s = 1 == (f = 0), i = 0 <<
                 1, setjmp(p[3]), i < 4 && (j = i + 1, setjmp(p[1]), j < 5 && (
                 (017 &g[j]) > (g[i] &15) && (k = g[i], g[i] = g[j], g[j] = k), j
                 ++, longjmp(p[1])), i++, longjmp(p[3])), setjmp(p[0]), i-- && !(
                 (g[1+i] ^ g[i]) >> 4) && longjmp(p[0]), setjmp(p[1]), --j && (!(k
                 = (g[j] &15) - (g[j - 1] &017) + 1) || (!(j - 1) && (8 ==  - k)))
                 && longjmp(p[1]), s += 3 * !j | !(++i ^ 17), (j *= i *= 4) && (i
                 = 1), setjmp(p[3]), 5-j < 2 && (j = 0, setjmp(p[1]), 5-i > j && (
                 (g[j] ^ g[j + 1]) &0xf ? g[j] ^= g[j]: (s += ((g[j] &0xf) > 8 &&
                 f++, !!g[j] *i)), j++, longjmp(p[1])), i++, longjmp(p[3])), s = 1
                 ^ s ? "AACEDJQZHello World"[s] - 'A': !!f, s += (!i)*(6+12 * s -
                 !!s *(g[2] &017 ^ 0xa ? 8 :  - 192)), s--, s *= b, printf(
                 "$%d (%d) \n", c += s, s + b), i = 0, setjmp(p[0]), 6 > i && (j =
                 1, setjmp(p[1]), 0 <= j && (e[i + j] ^= *(i - j + e+(j << 1)),
                 --j, longjmp(p[1])), i += ++i, longjmp(p[0])), longjmp(p[2])));
   }


Click here to preview the C/C++ Code Formatting Demo 1, C/C++ Code Formatting Demo 2 and C/C++ Code Formatting Demo 4.

With FormatCode C++ Code Formatters, you can format and transform any foreign C source code to meet your preferred coding style or any common code convention in several seconds!