Compiled this code from the Programming: Practice and Principles Using C++ pdf. It runs fine but gives me weird symbols, letters and numbers in
<<"char("<< c <<")\n";
Here's the complete code:
1 2 3 4 5 6 7 8 9 10 11 12 13
int main()
{
double d = 0;
while (cin >> d)
{
int i = d;
char c = i;
int i2 = c;
cout <<" d = " << d
<<"\ni = " << i
<"\ni2 = " << i2
<<"\nchar("<< c <<")\n";