main(){
int num1=9, num2, *ptr1, *ptr2;
ptr1 = &num1;
ptr2 = &num2;
*ptr2 = *ptr1;
printf("ptr1 is %d.\nptr2 is %d", *ptr1, *ptr2);
system("pause");
}
Type: Posts; User: eleven
main(){
int num1=9, num2, *ptr1, *ptr2;
ptr1 = &num1;
ptr2 = &num2;
*ptr2 = *ptr1;
printf("ptr1 is %d.\nptr2 is %d", *ptr1, *ptr2);
system("pause");
}
i tried this using int. it didnt work. why is that?
main(){
int num1=9, num2, *ptr1, *ptr2;
ptr1 = num1;
ptr2 = num2;
*ptr2 = *ptr1;
gamit ka ng rand()