Atof

Atof

The atof function in the C programming language is used to convert a string into a numerical representation.

:double atof (const char *string)

Note that where as atoi and atol return variable types corresponding with their name ("atoi" integer and "atol" long integer), atof however, does not. Because of that, people tend to expect atof to return a float, while in fact it returns a double.

Where string is the textual representation of a double. If the string is not a valid textual representation of a double, atof will silently fail, returning a random value. It's better and safer to use strtod.


Wikimedia Foundation. 2010.

Игры ⚽ Поможем сделать НИР

Look at other dictionaries:

  • Atof — Функция atof в языке программирования Си используется для приведения (конвертации) строки в числовой вид (к числовому типу). Её объявление выглядит следующим образом double atof (const char *string) где string текстовое представление числа с… …   Википедия

  • atof — Функция atof в языке программирования Си используется для приведения (конвертации) строки в числовой вид (к числовому типу). Её объявление выглядит следующим образом double atof (const char *string) где string  текстовое представление числа… …   Википедия

  • ATÖF — Die Abkürzung ATÖF steht bzw. stand für: Almanya Türk Öğrenci Federasyonu (Türkische Studentenföderation in Deutschland) Almanya Türk Öğretmen Dernekleri Federasyonu (Bund der Türkischen Lehrervereine in Deutschland e. V.) Diese Seite ist eine… …   Deutsch Wikipedia

  • ATOF — ASCII TO Float Umwandlungsroutine einer Zeichenkette in eine Fliesskommazahl, u.a. in C …   Acronyms

  • ATOF — ASCII TO Float Umwandlungsroutine einer Zeichenkette in eine Fliesskommazahl, u.a. in C …   Acronyms von A bis Z

  • ATOF — abbr. A Touch Of Frost (TV programme) …   Dictionary of abbreviations

  • Atoi — Функция atoi (ASCII to integer, из ASCII в целое цисло) в языке программирования Си используется для приведения (конвертации) строки в числовой вид. int atoi(const char *str) Аргумент str означает строку, представленную в виде массива символов,… …   Википедия

  • atoi — Функция atoi (ASCII to integer, из ASCII в целое число) в языке программирования Си используется для приведения (конвертации) строки в числовой вид. int atoi(const char *str) Аргумент str означает строку, представленную в виде массива символов,… …   Википедия

  • Atoi — The atoi (ASCII to Integer) function in the C programming language is used to convert a string into a numerical representation.:int atoi (const char *string) Where string is the string, represented by an array of characters. When atoi encounters… …   Wikipedia

  • Comparison of programming languages (basic instructions) — Programming language comparisons General comparison Basic syntax Basic instructions Arrays Associative arrays String operations …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”