Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Dec 29th, 2005, 5:11 AM   #1
irish
Programmer
 
Join Date: Nov 2005
Location: Belfast
Posts: 34
Rep Power: 0 irish is an unknown quantity at this point
Beeping in DOS

I was just wondering if anyone knew how i could make a beeping come from the computer when the user presses a key(such as enter)?

For example, a quiz and when they finish it(and press enter), a beeping comes from the computer before DOS closes.
irish is offline   Reply With Quote
Old Dec 29th, 2005, 5:19 AM   #2
LOI Kratong
Professional Programmer
 
Join Date: May 2005
Location: Woo - Boot Sector!
Posts: 294
Rep Power: 4 LOI Kratong is on a distinguished road
std::cout << "\a";
__________________
www.heldtogether.co.uk
LOI Kratong is offline   Reply With Quote
Old Dec 29th, 2005, 5:34 AM   #3
irish
Programmer
 
Join Date: Nov 2005
Location: Belfast
Posts: 34
Rep Power: 0 irish is an unknown quantity at this point
thanks
irish is offline   Reply With Quote
Old Dec 29th, 2005, 1:24 PM   #4
badbasser98
Hobbyist Programmer
 
Join Date: Mar 2005
Location: United States
Posts: 124
Rep Power: 4 badbasser98 is on a distinguished road
Nice, this will be usefull to me as well

-BB98
__________________
Learning to use C++ and loving every minute of it.
badbasser98 is offline   Reply With Quote
Old Dec 30th, 2005, 5:06 PM   #5
nnxion
Programming Guru
 
nnxion's Avatar
 
Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5 nnxion is on a distinguished road
You gotta be kidding me, please don't use those annoying beeps in one of your programs, I'll delete your program, hack your website and call the cops to storm your house .
__________________
"Employ your time in improving yourself by other men's writings, so that you shall gain easily what others have labored hard for."
-- Socrates
nnxion is offline   Reply With Quote
Old Dec 30th, 2005, 8:06 PM   #6
Cerulean
Professional Programmer
 
Cerulean's Avatar
 
Join Date: Apr 2005
Location: London, England
Posts: 459
Rep Power: 4 Cerulean is on a distinguished road
You can disable the beeps if they annoy you, you know. They're useful to provide audible feedback or to grab the user's attention in the absence of more advanced methods for doing so.
Cerulean is offline   Reply With Quote
Old Dec 31st, 2005, 3:19 AM   #7
chabayo
Newbie
 
Join Date: Dec 2005
Posts: 3
Rep Power: 0 chabayo is on a distinguished road
..hi, i'm sorry for break into it...

...but will someone explain the parsing of that

std::cout << anything

?? - just now a 'little' on c, so as i would try it would look like this

#include <stdlib.h>
char  *anything;
void main () {
    wirte ( 1 ,  *anything , strlen (anything)) }

...is that correct?
chabayo is offline   Reply With Quote
Old Dec 31st, 2005, 4:31 AM   #8
nnxion
Programming Guru
 
nnxion's Avatar
 
Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5 nnxion is on a distinguished road
Quote:
Originally Posted by chabayo
..hi, i'm sorry for break into it...

...but will someone explain the parsing of that

std::cout << anything

?? - just now a 'little' on c, so as i would try it would look like this

#include <stdlib.h>
char  *anything;
void main () {
    wirte ( 1 ,  *anything , strlen (anything)) }

...is that correct?
No it's not, and why not use printf?
#include <stdio.h>
char * anything = "hi";
main()
{
	printf("%s\n", anything);
}
I'd still just use C++.
__________________
"Employ your time in improving yourself by other men's writings, so that you shall gain easily what others have labored hard for."
-- Socrates
nnxion is offline   Reply With Quote
Old Jan 1st, 2006, 4:21 PM   #9
chabayo
Newbie
 
Join Date: Dec 2005
Posts: 3
Rep Power: 0 chabayo is on a distinguished road
...thx @ xion...but nice try...wasn't it??*g..

...lol...& a happy new year!!!


beside:
pokemon:~$ echo '
int main () {
std::cout << "hello\n"; }
' > main.cc
pokemon:~$ gcc main.cc
main.cc: In function `int main()':
main.cc:3: error: `cout' undeclared in namespace `std'
chabayo is offline   Reply With Quote
Old Jan 1st, 2006, 6:53 PM   #10
InfoGeek
Professional Programmer
 
InfoGeek's Avatar
 
Join Date: Jun 2005
Location: India, The great.
Posts: 435
Rep Power: 4 InfoGeek is on a distinguished road
You forgot to include iostream.
__________________
PFO - My daily dose of technology.
InfoGeek is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 8:24 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC