II-214 Programming Concepts
clrscr();
printf("%s",f);
}
Bug: & is not needed
5.
#include <stdio.h>
void main()
{int *t,x;t=&x;x=11;
*t++;
clrscr();
printf("%d",*t);
}
Bug: *t++; does not work. It must be ++*t;.
With this change this answer will be 12.
6.
#include <stdio.h>
void main()
{
int t[]={1,2,3,4,5};
int *p,*q,*r;p=t;q=p[1];
r=p[2];
clrscr();
printf("%d %d %d",*p,*q,*r);
}
Bug: & is required in q=p[1]; and r=p[2];
7.
#include <stdio.h>
void main()
{
int num[2][3]={1,2,3,4,5},*k;
k=#
clrscr();
printf("%d",*k);
}
Bug: k=# should be k=&num[0][0];
M09_ITL-ESL4791_02_SE_C09.indd 214 12/22/2012 5:04:03 PM