I am trying to get the program to print the address in hex numbers ex. 0X2000.
What can I do to get my program to print it like that.
Code:
#include<stdlib.h>
#include<stdio.h>
void cube(double*);
main(){
double variable=3.43;
int* pVariable;
printf("Value of variable is %.2lf\n",variable);
printf("Address of variable is %p\n",&variable);
pVariable=&variable;
cube(&variable);
printf ("New value for variable is %lf\n",variable);
system("Pause");
}
void cube(double* pVariable){
printf("The number %.2lf\n",*pVariable);
*pVariable=*pVariable * *pVariable * *pVariable;
printf("The address of pVariable is %p\n",pVariable);
}