About 5,970,000 results
Open links in new tab
  1. How does atoi() function in C++ work? - Stack Overflow

    The C version of atoi loops through each character in the string. The *str++ does several things (it's important to understand how it works, but it's a horrible way to actually write C). It's …

  2. c - atoi () — string to int - Stack Overflow

    Feb 21, 2015 · The atoi, atol, and atoll functions convert the initial portion of the string pointed to by nptr to int, long int, and long long int representation, respectively.

  3. What is the difference between std::atoi () and std::stoi?

    Oh by the way, std::atoi is not the corresponding C function to std::stoi, that would instead by std::strtol, which I recommend over atoi.

  4. use of atoi() function in c++ - Stack Overflow

    0 according to the documentation of atoi(), the function expects a "pointer to the null-terminated byte string to be interpreted" which basically is a C-style string. std::string is string type in C++ …

  5. usage difference between "atoi" and "strtol" in c - Stack Overflow

    I have been using atoi for a year now and I have an issue in the recent days that the expression: atoi("20") is giving a value of 0 as output. When I Google'd the issue I found that it is …

  6. How to check to ensure you have an integer before calling atoi()?

    Oct 3, 2010 · The atoi, atol, and atoll functions convert the initial portion of the string pointed to by nptr to int, long int, and long long int representation, respectively.

  7. C++ Error: 'atoi' is not a member of 'std' - Stack Overflow

    Apr 15, 2025 · 2 atoi and atof are declared in the C standard library header. <stdlib.h> used as atoi and its counterpart <cstdlib> used as std::atoi if you removed these headers and it will …

  8. c++ - How do I tell if the c function atoi failed or if it was a string ...

    42 When using the function atoi (or strtol or similar functions for that matter), how can you tell if the integer conversion failed or if the C-string that was being converted was a 0? For what I'm …

  9. atoi — how to identify the difference between zero and error?

    But Why? and How? First understand that both atoi and strtol only convert the initial set of numbers in a string to numeric values. Any trailing non-numeric characters are simply ignored. …

  10. atol(), atof(), atoi() function behaviours, is there a stable way to ...

    Dec 8, 2010 · It seems like you want to create a bijective mapping between arbitrary character strings and real numbers. That's not what the atol(), atoi() and atof() functions are for - they're …