#include [stdio.h]int main(){ char a, *pa; int c, *pc; pa = &a; pc = &c; *pa = sizeof(pa); *pc = sizeof(pc); printf("%d %d %d %d", a, c, sizeof(a), sizeof(c)); return 0;}
举一反三
- #include [stdio.h] int main() { int a=1; int *pa; pa=&a; *pa=3; printf("a=%d\n",a); return 0; }
- #include [stdio.h] int main() { int a=1; int *pa; pa=&a; printf("a=%d\n",a); printf("*pa=%d\n",*pa); *pa=2; printf("a=%d\n",a); return 0; }的运行结果()
- 分析下面的程序,下列说法中错误的是 ________ 。 #define NULL 0 #include "conio.h" struct stu { long num; char name[20]; int score; struct stu * next; }; int main() { struct stu *head,*p,*pa,*pb,*pc; pa=(struct stu *)malloc(sizeof(struct stu)); pb=(struct stu *)malloc(sizeof(struct stu)); pc=(struct stu *)malloc(sizeof(struct stu)); scanf("%ld%s%d",&pa->num,pa->name,&pa->score); scanf("%ld%s%d",&pb->num,pb->name,&pb->score); scanf("%ld%s%d",&pc->num,pc->name,&pc->score); head=pa; pa->next=pb; pb->next=pc; pc->next=NULL; p=head; while(p!=NULL) { printf("%ld,%s,%d\n",p->num,p->name,p->score); p=p->next; } }
- 若有定义char a=‘\10',*pa=&a;则sizeof(pa)的值为 。 A: 1 B: 2 C: 4 D: 8
- 9-7设汽车以匀速v通过图示路面A、B、C三处时,车对该三处路面的压力大小分别为PA、PB、PC,则( )[img=392x150]180328f84aab1a8.png[/img] A: PA=PB=PC; B: PB>PA<PC; C: PB<PC<PA; D: PB<PA<PC。