hey guys does anyone know why this code will not make a sound alert im compiling it in ansi c using linux?
Code:#include <stdlib.h> #include <stdio.h> int main (void) { char beep = '\007'; printf("%c", beep); return EXIT_SUCCESS; }
hey guys does anyone know why this code will not make a sound alert im compiling it in ansi c using linux?
Code:#include <stdlib.h> #include <stdio.h> int main (void) { char beep = '\007'; printf("%c", beep); return EXIT_SUCCESS; }
Most likely because your terminal isn't setup/configured to beep when it receives the ASCII BEL character.
By the way, you should use '\a' for a beep, it doesn't assume ASCII and isn't a magic number.
The alert character (\a), added by C90, produces an audible or visible alert. The nature of the alert depends on the hardware, with the beep being the most common. (With some systems, the alert character has no effect.)
Do you mean C89?added by C90
My Linux terminal doesn't beep by default, either. DOS does. You'll have to configue your terminal if you really want to have your ears blasted away.im compiling it in ansi c using linux
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.