0
I wonder if there is any difference using %d instead of %p to return the pointers address. Using the %d operator is good programming practice?
int a, *aPtr;
aPtr = &a;
printf("Digite o valor de a : ");
scanf("%d",&a);
/*
printf("O valor de a e : %d \n",a);
printf("O valor de *a e : %d \n",*aPtr);
printf("\n");
printf("O endereco de a e %d \n",&a);
printf("O endereco de *aPtr e %d \n",aPtr);
*/
printf("O valor de a e : %d \n",a);
printf("O valor de *aPtr e : %d \n",*aPtr);
printf("O endereco de a e : %p \n",&a);
printf("O endereco de *aPtr e : %p \n",aPtr);
This answers your question? The difference between %p and %d in language C?
– Rafael Tavares
Thank you, you managed to clear up some doubts!
– Matheus Santos