X9DW
X9DW

Reputation: 13

Cmd makes a "beep" every time I input 7

When I execute this, every time I input 7 the PC makes a "beep". Can someone explain me why? I use this header: http://www.stroustrup.com/Programming/std_lib_facilities.h

int main()
{
    double d = 0;
    while (cin >> d){
        int i = d;
        char c = i;
        int i2 = c;
        cout << "d==" << d
            << " i==" << i
            << " i2==" << i2
            << " char==(" << c << ")\n";
    }
}

Upvotes: 1

Views: 39

Answers (1)

Chuck Walbourn
Chuck Walbourn

Reputation: 41067

ASCII character 7 is the bell character dating back to the ancient days of teletype...

Upvotes: 2

Related Questions