반응형
포인터변수 시험문제
#include <stdio.h>
#include <stdlib.h>
#define P(M) printf("%d: %c %c %u %u %s\n", M,y,*px,px,x,x)
main() // 100 101 102 103 104 105 106 107 108
{
char y, x[]="ASD" , *px;
printf("%u %u %u\n", x,&px,&y);
px=x; // &x[0]
y=*px; P(1);
y=*px+1; P(2);
y=*(px+1); P(3);
*px +=1;
y=*px; P(4);
(*px)++;
y=*px; P(5);
y=*px++; P(6);
y=*px='\0'; P(7);
system("pause");
}
반응형
'다른공부 > C언어' 카테고리의 다른 글
20160602 c언어 교양 (1) | 2016.06.02 |
---|---|
20160524 c언어교양 (0) | 2016.05.24 |
20160517 c언어 교양 (0) | 2016.05.17 |
c언어 교양 20160510 (0) | 2016.05.10 |
20160503 c언어 교양 (0) | 2016.05.03 |