#include
int main(void)
{
int a = 10, b = 200;
printf("a = %-3d\nb = %-3d\n", a, b);
//列印整數用三位數排版
int ya = 777;
int* ptr = &ya; //宣告指標(*可放前、後)
printf("ya = %d\n", *ptr);
printf("ya = %d\n", ptr);
printf("ya = %d\n", &ptr);
printf("ya = %d\n", &ya);
system("PAUSE");
return 0;
}
----------------------------------------------
執行結果:
a = 10
b = 200
ya = 777
ya = 2293620
ya = 2293616
ya = 2293620
請按任意鍵繼續 . . .
--