outputing the '^' character

how do I output the ^ char to a console application?
jkelly061597Asked:
Who is Participating?
 
mflamConnect With a Mentor Commented:
Do you mean the escape char?
Ascii 27 ("^[", Hex 1B, Oct 32)?
If so you simply:
     printf("\32"); /* or */
     printf("\x1b");
     /* 33 octal is 27 decimal */
Of course you won't see anything, unless you are writing to a special file recording (and not using the stdout).

AQRG1 (All Questions R Good 1s)
Moshe Flam
0
 
jkrCommented:
What about using

#include <stdio.h>

//..

printf ( "^");

?
0
 
nietodCommented:
There must be a million answers.  Why do you think this is diffferent than any other character?  what language are you using?
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
jkrCommented:
>>There must be a million answers

Well, let's say, approximately e^pi ;-)
0
 
jkrCommented:
>>what language are you using?

<LOL> C/C++, I guess...
0
 
ozoCommented:
#include <iostream.h>
cout<<'^';
0
 
nietodCommented:
Opps.  I though this was the widnows topic area.  
0
 
bmanenCommented:
just adding to ozo's a bit;

#include <iostream>
using namespace std;

cout << "^";


but like the others said that is one of a million
0
 
nietodCommented:
>> Do you mean the escape char?
Is this an answer?
0
 
ozoCommented:
Apparently it is.  And apparently jkelly did mean the escape char.
mflam, how did you ever manage to deduce that from the question?
0
 
mflamCommented:
Ozo, the bottom line on my aswer explains that.
I won't be following this discussion further, sorry. (Too much mail)
Have a look at my companies site:
  http://www.pashute.com

0
 
nietodCommented:
jkelly, is that the anwer you wanted?  If not please don't accept bad answers.  That just encourages more bad answers.
0
All Courses

From novice to tech pro — start learning today.