Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- void printIntArray(int *ip,int count);
- int main() {
- int a[5]={3,5,2,7,9};
- printf("a = %x\n",a);
- printf("add of a[0] = %x\n",&a[0]);
- int* ap = a;
- printf("ap = %x\n",ap);
- printf("value in ap = %d\n",*ap);
- *ap=22;
- printf("new value in ap %d\n",*ap);
- printf("a array is...\n");
- printIntArray(a,5);
- ap+=3;
- printf("ap = %x\n",ap);
- printf("value in ap = %d\n",*ap);
- printf("one data size is %d units\n",ap-a);
- printf("size of int is %d bytes\n",sizeof(int));
- return 0;
- }
- void printIntArray(int *ip,int count)//int * ip = a; int count = 5;
- {
- for(int i=0;i<count+7;i++)
- {
- printf("index = %d value = %d\n",i,*ip);
- ip++;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement