How to convert a string into integer?

How to convert a string into integer?

I have given you a example. That's solve your problem.

int s(char str[])
{
    int n=0,m;
    for(int m=0;str[m]>='0' && str[m]<='9';m++)
    n=10*n+(str[m]-'0');
    if(m

By:Vivek Kr. Agarwal
Date:2006-01-09 00:00:00

Post Your Answers


User Email:

User Name:
Answers:

Related C Subjective Links

C Subjective interview questions and answers for experienced and fresher