| delorie.com/archives/browse.cgi | search |
| Message-ID: | <B0000041675@datasoft.datasoft.com.br> |
| From: | "Cristovao Braga" <cbraga AT datasoft DOT com DOT br> |
| To: | "rellwood" <rellwood AT aludra DOT usc DOT edu> |
| Cc: | "djgpp list" <djgpp AT delorie DOT com> |
| Subject: | Re: char to int |
| Date: | Sun, 2 Mar 1997 02:29:20 -0300 |
| MIME-Version: | 1.0 |
> From: rellwood <rellwood AT aludra DOT usc DOT edu>
>
> 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
The conversion is handled automatically by the compiler. But if you must...
main ()
{
char c; int i;
i = (int) c;
c = (char) i;
}
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |