Thread: C: Analysis of code

  1. #1
    Registered User
    Join Date
    Feb 2015
    Posts
    6

    C: Analysis of code

    Can someone explain this code step by step:

    Code:
    #include <stdio.h>
    #define MAX 10
    int main()
    {
    char niz[MAX][MAX], c = 0;
    int d = 1, x = 0, i, j;
    do scanf("%s", niz[x]);
    while (niz[x++][0] != '0');
    {
    float* pf;
    int xx, *pi = (int*)&niz[0][7];
    xx = ((*pi) & 0x41000000);
    pf = (float*)&xx;
    printf("%5.2f\n", *pf);
    }
    for (c-=--x; c++&**niz; d+=!(c<<x>0)) d<<=1;
    d -= c;
    for (i = 0; i < x;
    i==1?printf("%c ", niz[i][x>>1]):i, ++i)
    for (j = 0; j <= x - i;
    printf("%c", niz[i][j++]));
    printf("%x", d);
    return 0;
    }
    Input: code analysis
    Output: 8.00
    codann 6

  2. #2
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    5,108
    O_o

    Crashes... unless you get lucky.

    Soma
    “Salem Was Wrong!” -- Pedant Necromancer
    “Four isn't random!” -- Gibbering Mouther

  3. #3
    Programming Wraith GReaper's Avatar
    Join Date
    Apr 2009
    Location
    Greece
    Posts
    2,738
    Sorry for being cynical, but I'll try to explain your code step by step if you do the same with mine:
    Code:
    main()    {p(O(O(O(  O(O(O(O(O(  O(O(O(O(O       (O
    (p(O(O(   p()))))))  ))))))))))  ));puts(""     ,p(o
    (p    (o  (o             (o      (o      (o    (o  (o
    (o    (o  (o             (o      (o      (o   (o    (o
    (o    (o  (o())))))      ))      ))))))))    ))))));}x=
    59    ;O  ()             {x      ++      ;}  o(      ){
    +x    --  ;}             p(      ){      ;;  ;;      ;;
    putchar   (x             +9      );x;-x;}    q(      );
    Devoted my life to programming...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. tools for static code analysis
    By lehe in forum C++ Programming
    Replies: 2
    Last Post: 03-18-2009, 12:41 PM
  2. Code Analysis
    By guesst in forum C++ Programming
    Replies: 8
    Last Post: 09-09-2008, 04:17 PM
  3. Looking for Code Analysis / Checking Tool
    By nvoigt in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 06-01-2007, 03:34 AM
  4. static code analysis
    By markucd in forum C++ Programming
    Replies: 1
    Last Post: 11-25-2005, 06:27 AM
  5. Source Code Analysis Tool?
    By Sereby in forum C Programming
    Replies: 4
    Last Post: 02-18-2005, 09:11 AM