Hi, would you guys know how to actually print out symbols like:
pi, theta and etc? thank you
Hi, would you guys know how to actually print out symbols like:
pi, theta and etc? thank you
If you're talking about the standard characters above 128 decimal, two main ways:
1) #define charname 0xFF
replace FF with the hex value of the character in question and display it as a character.
putchar(charname);
printf("%c", charname);
2) printf("\xFF\xFF...");
of course replace FF with the value of the character to output
Definition: Politics -- Latin, from
poly meaning many and
tics meaning blood sucking parasites
-- Tom Smothers
Would you know where I could get the hex value for the special characters?
Anything above the ASCII defined stuff is different on every OS. You're probably out of luck if you want to display pi and such, unless you display them as a graphic (which would require a library)
Away.
As noted, the extended characters aren't guaranteed, but you might look here for an idea of how they work:Originally posted by godhand
Would you know where I could get the hex value for the special characters?
http://www.asciitable.com/
When all else fails, read the instructions.
If you're posting code, use code tags: [code] /* insert code here */ [/code]
Thanks Hammer!
and you can do things like:Code:printf("%c\n%c %cd%c\n%c\n",244,179,227,227,245);
to simplify itCode:#define YEN 157 #define F_FUNC 159 #define HALF 171 #define FOURTH 172 #define PI_SYM 227 #define PHI 232 #define OMEGA 234 #define MU 230 #define BETA 225 #define ALPHA 224 #define INFINITY 236 #define SQRRT 251 #define SQRD 253 #define ABOUT 247 #define DIV 246 #define PLUS_MINUS 241 #define LESS_EQUAL 242 #define GREAT_EQUAL 243 #define INTEGRAL_TOP 244 #define INTEGRAL_MID 179 #define INTEGRAL_BOT 245
__ON WINDOWS!__
-LC
Asking the right question is sometimes more important than knowing the answer.
Please read the FAQ
C Reference Card (A MUST!)
Pointers and Memory
The Essentials
CString lib
It happens that my Debian linux does not have extended ascii characters, do any linux guru here knows how I can somehow add the extended ascii to my linux?