新关键字用作标识符

时间:2016-10-13 10:03:53

标签: c++ linux

我正在寻找C ++代码来获取linux的getch()和getche()函数。我简要地看了一下代码,发现他们正在使用new关键字,就像标识符一样。

这是链接: What is Equivalent to getch() & getche() in Linux?

static struct termios old, new;
tcsetattr(0, TCSANOW, &new); /* use these new terminal i/o settings now */

任何人都可以解释它是如何可能的吗?它是有效的C ++代码吗?感谢。

1 个答案:

答案 0 :(得分:6)

这是有效的C代码,但有效的C ++。

new是C ++中的关键字,不能用作变量名。

相关问题