[ create a new paste ] login | about

Link: http://codepad.org/h2bU7TMg    [ raw code | output | fork ]

C++, pasted on Jul 4:
#include <stdio.h>
#define MAX 10
int main()
{
    char array[MAX][MAX], c = 0;
    int d = 1, x = 0, i, j;
     
    do
        scanf("%s", array[x]);
    while (array[x++][0] != '0');
     
    {
        float* pf;
        int xx, *pi = (int*)&array[0][7];
        xx = ((*pi) & 0x41000000);
        pf = (float*)&xx;
        printf("%5.2f\n", *pf);
    }
     
    for (c- = --x; c++ & **array; d+=!(c << x > 0)) 
        d<<=1;
         
    d -= c;
     
    for (i = 0; i < x; i == 1 ? printf("%c ", array[i][x >> 1]):i, ++i)
        for (j = 0; j <= x - i; printf("%c", array[i][j++]));
    printf("%x", d);
     
    return 0;
}


Output:
1
2
3
4
5
cc1plus: warnings being treated as errors
In function 'int main()':
Line 16: warning: dereferencing type-punned pointer will break strict-aliasing rules
Line 20: error: expected primary-expression before '=' token
compilation terminated due to -Wfatal-errors.


Create a new paste based on this one


Comments: