有趣的指针

写了一段程序:

#include "stdio.h"
#include "stdlib.h"

void main()
{
int n;
printf("please input n:\n");
scanf("%d",&n);
n += 5;
n /= 10;
printf("%s\n","**********" + 10 - n );
}

./4.out
please input n:
10
*
 ./4.out
please input n:
20
**
./4.out
please input n:
30
***
./4.out
please input n:
101
**********
./4.out
please input n:
120
d

一种简单把二进制转换为字符的方法

putchar("0123456789ABCDEF" [value % 16]);


"xyz" + 1 = "y"

*"xyz" = "x"

"xyz"[2] = "z"

字符串常量实际是个指针

你可能感兴趣的:(C语言,指针)