我們如何在表格中排列這個值,以便地址值和名稱以正確的行出現在列中?如何在c中創建這個給定代碼的表?
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
int main() {
int tuna = 20;
printf("Adress \t Name \t Value \n");
printf("%p \t %s \t %d \n",&tuna , "tuna", tuna);
int * pTuna = &tuna;
printf("%p \t %s \t %d \n", pTuna, "tuna", tuna);
printf("%p \t %s \t %p \n", &pTuna, "tuna", pTuna);
_getch();
return 0;
}
每個字段的最大長度是多少? – manetsus
其變量的存儲地址可以是隨機的 –