[ create a new paste ] login | about

Link: http://codepad.org/lNNoQMVC    [ raw code | output | fork | 3 comments ]

C, pasted on Nov 13:
1
2
3
4
5
6
7
8
#include <stdio.h>

int main()
{
    int * ptr = 0;
    short * sptr = ((short *)ptr + 1);
    printf("%d %d", (int)ptr, (int)sptr);
}


Output:
1
2
0 2
Exited: ExitFailure 3


Create a new paste based on this one


Comments:
posted by p_zunlzhu@tencent.com on Feb 5

reply
posted by p_zunlzhu@tencent.com on Feb 5
void func1(short* p)
{
printf("%d",1);;

return;
}
reply
posted by p_zunlzhu@tencent.com on Feb 5

reply