Thread: Escape sequences Understanding!

  1. #1
    Registered User
    Join Date
    Nov 2017

    Smile Escape sequences Understanding!

    Alright! we all have heard about escape sequences in C like '\b\,'\a' , etc.

    I have a question regarding it.

    As we all can notice , escape sequences are formed by joining two characters 1.'\' , 2.'a','b','f',etc.

    Now the resultant "thing" we call as an escape sequence which is nothing but another character having an ASCII Value like , 008 for '\b'.

    And furthermore , these characters can produce sound('\a') , move the cursor up , right , back , likewise.

    So it fascinates me into thinking as to how can just a simple ASCII value can produce sound , since ASCII only has 7 -bit

    Furthermore there are Trigraph Characters which are combination of three characters like '??>' meaning {.

    So as we can see how can we join different character to form a new character

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Quote Originally Posted by ranadas
    So it fascinates me into thinking as to how can just a simple ASCII value can produce sound , since ASCII only has 7 -bit
    Shouldn't you likewise be fascinated into thinking how "just a simple ASCII value" can produce a little graphic on screen that we can identify as text, "since ASCII only has 7 -bit"?

    The answer is that it is your computer that does these things, not the character value. The character value is just data that is interpreted by the computer in the given context (i.e., your program logic, the operating system, or even the hardware).
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    misoturbutc Hodor's Avatar
    Join Date
    Nov 2013
    You only need 1 bit to produce music (a single bit of 0 or 1) not 7:


    Probably 8 bit (using just the PC speaker):


    With a rPi and a $0.50 ADC (8 bit) and a $0.50 DAC I managed to sample and playback pretty good quality songs/samples. The difference between 7- and 8-bit sound isn't going to be that much different. Not sure what that had to do with ASCII though. More impressive is the speech in old Commodore 64 games (e.g. Ghostbusters, Impossible Mission etc) which used algorithms to "compress" speech so that it could fit in the limited RAM available (ESS Technology - Wikipedia).

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. escape sequences
    By cfanatic in forum C Programming
    Replies: 2
    Last Post: 08-10-2012, 10:49 PM
  2. Escape sequences in c
    By linuxlover in forum C Programming
    Replies: 3
    Last Post: 11-03-2010, 02:39 PM
  3. C Escape sequences
    By Tool in forum C Programming
    Replies: 10
    Last Post: 11-20-2009, 09:38 PM
  4. Escape sequences in VC++
    By emilyh in forum Windows Programming
    Replies: 7
    Last Post: 09-26-2001, 07:02 AM
  5. Escape Sequences
    By Me-Again-Again in forum C Programming
    Replies: 3
    Last Post: 09-05-2001, 06:24 AM

Tags for this Thread