| delorie.com/archives/browse.cgi | search | 
| Date: | Sun, 2 Mar 1997 09:17:00 -0600 (CST) | 
| From: | Andrew Deren <aderen AT eecs DOT uic DOT edu> | 
| To: | rellwood <rellwood AT aludra DOT usc DOT edu> | 
| cc: | djgpp AT delorie DOT com | 
| Subject: | Re: char to int | 
| In-Reply-To: | <Pine.SV4.3.94.970301143114.733A-100000@aludra.usc.edu> | 
| Message-ID: | <Pine.SUN.3.95.970302091510.28674A-100000@ernie.eecs.uic.edu> | 
| MIME-Version: | 1.0 | 
You do not have to use any function just use: char ch; int i; ch = 'A'; i = ch; and this will set i to be 65 (ASCII for A). You can assign any character to integer. On 1 Mar 1997, rellwood wrote: > Is there a function I can use to convert a char to an int? The closest > thing I can find is atoi(), which actually converts a string. Is there > anything better? > > -Richard > >
| webmaster | delorie software privacy | 
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |