Re: I cant do change string to int.
- From: santosh <santosh.k83@xxxxxxxxx>
- Date: Sun, 11 Nov 2007 21:25:31 +0530
In article <1194796010.099997.68670@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>, emre
esirik(hacettepe computer science and engineering)
<emreesirik@xxxxxxxxx> wrote on Sunday 11 Nov 2007 9:16 pm:
char poli[50];
int p;
scanf("%s", poli);
if(poli[i]=='X' && poli[i+1]=='^')
{
toplam=i+3;
p=poli[i+2];
p is a ASCII code of integer but I need integer
for example if poli[i+2]='2' it puts p 50 (ascii code of '2')
but I need p=2 integer form, how can I do, please help
Do:
p = poli[i+2] - '0';
This only works for '0'... '9'.
.
- References:
- I cant do change string to int.
- From: emre esirik(hacettepe computer science and engineering)
- I cant do change string to int.
- Prev by Date: I cant do change string to int.
- Next by Date: Re: dumpbin with debug and release version
- Previous by thread: I cant do change string to int.
- Next by thread: Re: I cant do change string to int.
- Index(es):
Relevant Pages
|