[ create a new paste ] login | about

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

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

int main() 
{ 
int arr[5] = { 1, 2, 3, 4, 5 }; 
int *ptr = arr; 

printf("The address of first element is  %d\n and that of second is %d\n and values at first location is %u\n and value at second location is ,%u\n", ptr,(ptr+1), *ptr,*(ptr+1)); 
return 0; 
} 


Output:
1
2
3
4
The address of first element is  -4749764
 and that of second is -4749760
 and values at first location is 1
 and value at second location is ,2


Create a new paste based on this one


Comments: