Misplaced Pages

Atoi: Difference between revisions

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
Browse history interactively← Previous editContent deleted Content addedVisualWikitext
Revision as of 07:47, 29 May 2009 edit116.74.105.130 (talk) Standards conformance← Previous edit Latest revision as of 14:34, 11 June 2017 edit undoTom.Reding (talk | contribs)Autopatrolled, Extended confirmed users, Page movers, Template editors3,876,497 editsm +{{Redirect category shell}} for multiple-{{R}} #Rs using AWB 
(48 intermediate revisions by 24 users not shown)
Line 1: Line 1:
#REDIRECT ]
{{Unreferenced|date=January 2009}}
{{lowercase|title=atoi}}
The '''atoi''' ('''A'''SCII '''to''' '''i'''nteger) function in the ] is used to convert a string into a numerical representation.


{{Redirect category shell|1=
:<code>int '''atoi'''(const char *str) </code>
{{R with history}}

{{R to section}}
The <code>str</code> argument is a string, represented by an array of characters, containing the characters of a signed integer number. The string must be null-terminated. When atoi encounters a string with no numerical sequence, it returns zero (0). If the string holds a valid sequence of digits that represents the number 0, it also returns a 0, making it impossible to tell from the return value alone whether the string holds a valid number or not. The newer function ] 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 <code>long</code>, <code>float</code>, or <code>long</code> <code>long</code> type, respectively:

:<code>long '''atol'''(const char *str)</code>
:<code>double '''atof'''(const char *str)</code>
:<code>long long '''atoll'''(const char *str)</code> (])

==Standards conformance==

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


Atoi is character to string converter

==See also==
* ]
* ]
* ]
* ]

]
]

]
]

Latest revision as of 14:34, 11 June 2017

Redirect to:

This page is a redirect. The following categories are used to track and monitor this redirect:
  • With history: This is a redirect from a page containing substantive page history. This page is kept as a redirect to preserve its former content and attributions. Please do not remove the tag that generates this text (unless the need to recreate content on this page has been demonstrated), nor delete this page.
    • This template should not be used for redirects having some edit history but no meaningful content in their previous versions, nor for redirects created as a result of a page merge (use {{R from merge}} instead), nor for redirects from a title that forms a historic part of Misplaced Pages (use {{R with old history}} instead).
When appropriate, protection levels are automatically sensed, described and categorized.