标签:include 一个 one void == int 数组名 表达 return
1. ungetch() 把一个字符退回到键盘缓冲区中
#include <ctype.h>
#include <stdio.h>
int getch(void);
void ungetch(int);
int getint(int *pn)
{
int c, sign;
while (isspace(c = getch()))
;
if (!isdigit(c) && c != EOF && c != ‘+‘ && c != ‘-‘){
ungetch(c);
return 0;
}
sign = (c == ‘-‘) ? -1 : 1;
if (c == ‘+‘ || c == ‘-‘)
c = getch();
for (*pn = 0; isdigit(c); c = getchar())
*pn = 10 * *pn +(c - ‘0‘);
*pn *= sign;
if (c != EOF)
ungetch(c);
return c;
}
2. 数组名代表数组第一个元素的地址
3. 一个通过数组和下标实现的表达式都可以通过指针和偏移量实现,但是需要注意指针是一个变量,而数组名不是一个变量
标签:include 一个 one void == int 数组名 表达 return
原文地址:https://www.cnblogs.com/semie/p/11117669.html