why it gives me character eventhough getch() will return integer

Write your question here.

1
2
3
4
5
6
7
8
9
10
11
12
13
#include<iostream>
#include<cstring>
#include<conio.h>
using namespace std;
int main(){
system("color a9");
char a;



a=getch();
cout<<a;
}
A char is a number. char only ever contains a number. The only difference is in what you do with it. You are passing a number to cout, telling it that the number is a char.

http://www.asciitable.com/


crystal clear...thanks repeater...you make my day
Topic archived. No new replies allowed.