我们一般所使用的 getchar() 函数在读入一个字符时 必须按一下 enter 键,该代码才会继续运行;
但是 getch() 函数读入一个字符时 不用 enter 代码会继续跑;
#include <iostream>
#include <conio.h>
#include <stdio.h>
#include "Person.h"
#include <stdlib.h>
using namespace std;
int main()
{
int n = 1;
while (1) {
for (int i = 0; i < n; i++) {
cout << '*' ;
}
//cout << endl;
n++;
_getch();
system("cls");
}
return 0;
}