#include <stdio.h>
int main(void)
{
int i = 0;
int* pt1;
//pt1=ar1=&ar1[0]
//pt1 is the order of address storage, and you go to 77755 and read the value
//*The value at pt177755
unsigned int valA=0;
pt1 = valA;
valA = 30;
printf("Index 0 Addr: %u \r\n", &valA);
printf ("Please enter a value");
scanf_s("%u", &valA);
printf("input:%u \r\n", valA);
printf("*PT1:%u \r\n",*pt1);
return 0;
}
I think the address of valA
should be assigned to pt1
instead of valA
.
© 2024 OneMinuteCode. All rights reserved.