[ create a new paste ] login | about

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

sharkpp - C, pasted on Nov 28:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <stdio.h>

void check(int i) 
{
int n = -2147483648;
    if (i > -2147483648)   // C4146
        printf("%d is greater than the most negative int\n", i);
    if (i > -2147483647)   // C4146
        printf("%d is greater than the most negative int'\n", i);
    if (i > n)   // C4146
        printf("%d is greater than the most negative int''\n", i);
    if (i > (int)(-2147483648))   // C4146
        printf("%d is greater than the most negative int'''\n", i);
}

int main() 
{
    check(-2147483646);
    check(-100);
    check(1);
}


Output:
1
2
3
4
5
6
7
8
9
10
11
-2147483646 is greater than the most negative int
-2147483646 is greater than the most negative int'
-2147483646 is greater than the most negative int''
-2147483646 is greater than the most negative int'''
-100 is greater than the most negative int
-100 is greater than the most negative int'
-100 is greater than the most negative int''
-100 is greater than the most negative int'''
1 is greater than the most negative int'
1 is greater than the most negative int''
1 is greater than the most negative int'''


Create a new paste based on this one


Comments: