Why do I get this???

1student

Member
May 30, 2004
42
0
0
Hi,
I wrote a program in C++, and got somthing strange:
Enter a number 1
0x1a271046Enter a number 2
0x1a271046Enter a number +
0x1a271046Enter a number
The exercise you entered is: 1 2 +

enclosed is the program.

 

TheLonelyPhoenix

Diamond Member
Feb 15, 2004
5,594
1
0
:)

You were outputting the address of the cout object everytime you ran "cout<<cout<<"Enter a number ";"

When you see hex numbers in your output where they aren't supposed to be, it usually means you output a memory address accidently.