Sign in to follow this  
Guest zip

counterparts of ord and chr in C

Recommended Posts

Hi,I wonder what the corresponding functions are for ord and chr in CBrgdsEugen

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

In C/C++, a character is a byte (or a word if you are setup to use Unicode). There is no distinction. Anyway, the code below should illustrate:char c = 'A'; // should be ascii 65int i = (int)c; // i = 65 = ord('A')char zero = '0';char one = (char)((int)zero + 1); // chr function = '1'There are also some Win32 API or some C runtime library functions for each, and they support unicode (double byte, or word sized, characters).That's why they use ADA to program the F16 flight control systems...

Share this post


Link to post
Share on other sites

ADA! You said the ADA word! I am melting, ADA, ADA, ADA!When working for the U.S. Navy, ADA was being pushed down our throats as the next language to be used for all Government projects. Most colleges didn't support teaching ADA.Since being retired for almost four years, I don't know were ADA stands but it seemed to be declining even before I retired.Now excuse me, I have to go brush my teeth to get the ADA strings out between my teeth. I am going to gargle also to kill the ADA bacteria. Now were did I put that Listerine, UGH!!!W. Sieffert

Share this post


Link to post
Share on other sites

ADA-boy? Cheech, no respect for the daughter of Lord Byron...I'm not sure I want to admit I worked on that compiler...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this