Atoi

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 a string with no numerical sequence, it returns a 0 (zero). Also, if the string holds a valid sequence of digits that represents the number 0, it would also return a 0, making it impossible to tell from the return value alone whether the string held a valid number or not. The newer function strtol does not have this deficiency.

Variants of the atoi function, atol, atof, and atoll (the latter formerly known as atoq), are used to convert a string into a long, float, or long long integer, respectively:

:long atol (const char *string) :double atof(const char *string):long long atoll (const char *string) (C99)

tandards conformance

The atoi, atof, and atol functions are a part of the ISO standard C library (C89), while the atoll function is added by C99.

ee also

* atof
* itoa
* strtol


Wikimedia Foundation. 2010.

Игры ⚽ Нужен реферат?

Look at other dictionaries:

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

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

  • After Tax Operating Income - ATOI — A company s total operating income after taxes. This non GAAP measure excludes any after tax benefits or charges such as effects from accounting changes. Due to its non GAAP nature, what is included and excluded in the measure differs, therefore …   Investment dictionary

  • Interpreter — Ein Interpreter (im Sinne der Softwaretechnik) ist ein Computerprogramm, das einen Programm Quellcode im Gegensatz zu Assemblern oder Compilern nicht in eine auf dem System direkt ausführbare Datei umwandelt, sondern den Quellcode einliest,… …   Deutsch Wikipedia

  • Interpreter (Computer) — Ein Interpreter (im Sinne der Softwaretechnik) ist ein Computerprogramm, das einen Programm Quellcode im Gegensatz zu Assemblern oder Compilern nicht in eine auf dem System direkt ausführbare Datei umwandelt, sondern den Quellcode einliest,… …   Deutsch Wikipedia

  • Interpretersprache — Ein Interpreter (im Sinne der Softwaretechnik) ist ein Computerprogramm, das einen Programm Quellcode im Gegensatz zu Assemblern oder Compilern nicht in eine auf dem System direkt ausführbare Datei umwandelt, sondern den Quellcode einliest,… …   Deutsch Wikipedia

  • Niclas Hävelid — Born …   Wikipedia

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

  • Luhn-Algorithmus — Der Luhn Algorithmus oder die Luhn Formel, auch bekannt als „Modulo 10“ oder „mod 10“ Algorithmus und als Double Add Double Methode, wurde in den 1960er Jahren von Hans Peter Luhn als eine Methode der Überprüfung von Identifikationsnummern… …   Deutsch Wikipedia

  • Luhn-Formel — Der Luhn Algorithmus oder die Luhn Formel, auch bekannt als „Modulo 10“ oder „mod 10“ Algorithmus, wurde in den 1960er Jahren von Hans Peter Luhn als eine Methode der Überprüfung von Identifikationsnummern entwickelt. Er ist eine simple… …   Deutsch Wikipedia

Share the article and excerpts

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