[ create a new paste ] login | about

Link: http://codepad.org/LLJoJifW    [ 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  -146932
 and that of second is -146928
 and values at first location is 1
 and value at second location is ,2


Create a new paste based on this one


Comments: