Thread: How to make my computer beep

  1. #1
    Registered User
    Join Date
    Mar 2005
    Posts
    1

    How to make my computer beep

    I'm using DevC++ and I just want to knwo how to program it to make a beep from my computer speaker thast all I woudl liek to put that in a couple of my programs but I can't gfigure out hoq just yet woudl anybody please help me...Thanks

  2. #2
    Registered User caroundw5h's Avatar
    Join Date
    Oct 2003
    Posts
    751
    the escape sequence is '\a'.
    Warning: Opinions subject to change without notice

    The C Library Reference Guide
    Understand the fundamentals
    Then have some more fun

  3. #3
    People Love Me
    Join Date
    Jan 2003
    Posts
    412
    cout << (char)7;

  4. #4
    Registered User Kybo_Ren's Avatar
    Join Date
    Sep 2004
    Posts
    136
    Since your suggestion is system-specific, Krak, it's much better to use caround5h's standard suggestion.

  5. #5
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    While we're being system specific....
    Code:
    #include<windows.h>
    
    int main()
    {
        MessageBeep(MB_ICONEXCLAMATION);
        return 0;
    }
    gg

  6. #6
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    Posts
    5,681
    besides cout<<char(7); is much better looking

  7. #7
    Registered User
    Join Date
    Feb 2004
    Posts
    29
    Code:
    _asm
    {
    invoke beep
    }
    _asm
    something like that anyway

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Makefile Problem: None rule to make target
    By chris24300 in forum Linux Programming
    Replies: 25
    Last Post: 06-17-2009, 09:45 AM
  2. Establishing 'make clean' with GNU make
    By Jesdisciple in forum C Programming
    Replies: 9
    Last Post: 04-11-2009, 09:10 AM
  3. What to make?
    By Caldus in forum C++ Programming
    Replies: 4
    Last Post: 04-06-2005, 01:12 PM
  4. PHP on my Computer!
    By xxxrugby in forum Tech Board
    Replies: 4
    Last Post: 03-15-2005, 09:34 AM
  5. This is my last night on this computer.
    By joshdick in forum A Brief History of Cprogramming.com
    Replies: 18
    Last Post: 07-12-2003, 01:33 AM