?
Solved

Escape Code

Posted on 1998-10-01
10
Medium Priority
?
294 Views
Last Modified: 2010-04-15
If you want to type a backslash you have to do :
printf("\\");
if you want a bell it's \a
a horizontal tab is \t
...
What is the code for ESCAPE.
0
Comment
Question by:pchaloux
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
10 Comments
 
LVL 84

Expert Comment

by:ozo
ID: 1253157
"\033"
0
 
LVL 2

Expert Comment

by:kellyjj
ID: 1253158
the asci value of the escape key is 27 (dec).
0
 
LVL 1

Expert Comment

by:abhinavm
ID: 1253159
I didn't get what actually do you want. If you want to check which key is pressed then you can check it by comparing to 27 (ASCII for Esc). Why else you want a god for Escape?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 8

Expert Comment

by:Answers2000
ID: 1253160
33 is octal - 3*8 + 3 = 24 + 3 = 27
0
 
LVL 1

Expert Comment

by:Bonev
ID: 1253161
You cannot type the Escape character - it does not have graphical representation.

0
 

Author Comment

by:pchaloux
ID: 1253162
Ok guys, I got it, but could you please send an ANSWER so I could grade someone.
You only gave me COMMENTs...
0
 
LVL 9

Accepted Solution

by:
Pacman earned 200 total points
ID: 1253163
pchaloux,

that's all right, the ascii-code for escape is 27 (decimal), and 1B (hex)
so if you want to print it you may write

printf("%c", 27);

or

printf("\033");

ok ?

regards
Pacman
0
 
LVL 8

Expert Comment

by:Answers2000
ID: 1253164
The reason everybody was giving comments was that Ozo answered first in a comment and it usually considered good form to let him get the points because of this.

I suspect the reason he gave a comment rather than an answer was he was expecting you to ask a follow up question.

If you want to give Ozo the pts you can reject Pacman's answer and post a comment asking Ozo to lock the Quesiton
0
 

Expert Comment

by:manjucee
ID: 1253165
Hi
      when i tried to print it displays <- (left arrow) sign
printf("%c",27);
     when i tried to read it from keyboard i.e,.
ch=getch();
printf("%c",ch);
it displays the same sign
That mean thats the graphical representation of escape key ?
0
 
LVL 1

Expert Comment

by:Bonev
ID: 1253166
manjucee,
The Escape key is not intended to be shown; if you want to display left arrow, you just look at the ASCII table and pick the arrow from there. It's a coincidence that the image of ASCII code 27 is an arrow. I'm not sure, but I believe that the ASCII table does not defines images for the codes below 32.
The Escape key is a prefix for the "escape sequences" used to control different output devices.

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.
Suggested Courses
Course of the Month13 days, 18 hours left to enroll

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question