to make the pointer and address for student[i]
#include<stdio.h>
void main()
{
int *ptr;
int i,sum,num=1;
int students[]={6,4,8,3};
for (i=0; i<4;i++)
{
printf("%d - The Value For Student is %d\n",num++,students[i]);
sum=students[i];
*ptr=sum;
printf("%d - the value for Student[%d] is %d, has Pointer is %d and has Address is %d \n",num++,i,students[i],*ptr,&ptr);
}
}

New Topic/Question
Reply



MultiQuote




|