• +91 9723535972
  • info@interviewmaterial.com

C Interview Questions and Answers

Question - How can I convert a string to a number?

Answer - The standard C library provides several functions for converting strings to numbers of all formats (integers, longs, floats, and so on) and vice versa. The following functions can be used to convert strings to numbers: Function Name Purpose atof() Converts a string to a double-precision floating-point value. atoi() Converts a string to an integer. atol() Converts a string to a long integer. strtod() Converts a string to a double-precision floating-point value and reports any leftover numbers that could not be converted. strtol() Converts a string to a long integer and reports any leftover numbers that could not be converted. strtoul() Converts a string to an unsigned long integer and reports any leftover numbers that could not be converted.

Comment(S)

Show all Coment

Leave a Comment




NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners