C Programming and Computer Geeks

Search MY Blog

Thursday, 19 December 2013

String to Integer conversion function


int strtoint(char str[])
{
  int i=0,num=0;
    
  while (str[i]!='\0')
  {
     num=num*10+str[i]-'0';
     i++;
  }

  printf("Entered String = \"%s\" , After String to Int = %d",str, num);

  return num;
}

Output:

String to Integer Conversion
string to integer

 
Click here for more C Faq

Thursday, 5 December 2013

C Header Files and its supported functionalities


<stdio.h>: input /output functional operations in program.

<conio.h>: to clear screen and pause information function.

<ctype.h>: functions for testing characters.

<string.h>: functions for manipulating string.

<math.h>: mathematical  functionalities.

<stdlib.h>: utility function for number, conversion and storage allocation.

<assert.h>: functions that can be used to add diagnostics to a program.

<stdarg.h>: functions that can be used to step through a list of function arguments.

<setjmp.h>: functions that can be used to avoid the normal call and return sequence.

<signal.h>: functions for handling exceptional condition that may arise in a program.

<time.h>: functions for manipulating date and time.

<limits.h>: constant definitions for the size of C data types.

<float.h>: definitions relating to floating-point arithmetic.


Click here for more C Tutorials and Concepts.

 

Search This Blog