Program Responses (Beep)

Member
Posts: 281
Joined: 2009.04
Post: #1
I'm writing a game, and want to know where it's going wrong. In other IDE's, I'd make it beep, easy to code and remove. How can I tell the computer to System beep in C? I tried printf("/a"); and /7 but they don't seem to work. Huh

~ Bring a Pen ~
Quote this message in a reply
Moderator
Posts: 3,577
Joined: 2003.06
Post: #2
NSBeep(); will probably do the trick.
Quote this message in a reply
Member
Posts: 281
Joined: 2009.04
Post: #3
Thanks AnotherJake.

~ Bring a Pen ~
Quote this message in a reply
Moderator
Posts: 1,560
Joined: 2003.10
Post: #4
putchar('\a') (or printf("\a")) should work in at least some cases, as long as you use the right kind of slash.
Quote this message in a reply
Member
Posts: 281
Joined: 2009.04
Post: #5
Thanks. WackoBlinkBlushRolleyes

~ Bring a Pen ~
Quote this message in a reply
Oldtimer
Posts: 834
Joined: 2002.09
Post: #6
But there's a cooler way. In XCode, you can create a breakpoint, and then hop into the breakpoint editor (opt-cmd-B). Here, you can create the breakpoint to be one that beeps and keeps running.

Just unfold the gray triangle and make it a "sound breakpoint" and check the continue box on the far right.

I used this with great success when debugging my fullscreen switcher - a successful run would mean the "glass", "basso" and "glass" again sequence Wink
Quote this message in a reply
Member
Posts: 281
Joined: 2009.04
Post: #7
Cool Cool!

~ Bring a Pen ~
Quote this message in a reply
Post Reply