1

Possible Duplicate:
What do single quotes do in C++ when used on multiple characters?

One of the new students in our University asked me to help hem with some code.
his code:

#include <iostream>
using namespace std;
void main()
{
    cout << ('/0'); //his mistake - the / is upside down
    system("pause");
}

(this code was made with VS2008)
he expected to get a blank char, he got 12080.
I fond the mistake, but I still don't understand why he got 12080.

can someone explain this? is it different between platforms?

Community
  • 1
  • 1
elyashiv
  • 3,623
  • 2
  • 29
  • 52

1 Answers1

1

ASCII code

/ - 2F
0 - 30

Hex to DEC 
2F30 - 12080
billz
  • 44,644
  • 9
  • 83
  • 100