Особенности getch и getchar
Добавлено: 15 дек 2010, 15:32
Почему тут прога завершается после нажатия Enter
а ту нет и выдает код символа
Код: Выделить всё
#include <stdafx.h>
#include <conio.h>
using namespace std;
int main(){
int ch;
while((ch=getchar())!=10)
cout << ch << endl;
}
Код: Выделить всё
#include <stdafx.h>
#include <conio.h>
using namespace std;
int main(){
int ch;
while((ch=getch())!=10)
cout << ch << endl;
}