Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 926287
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T19:39:39+00:00 2026-05-15T19:39:39+00:00

If there are non-number characters in a string and you call atoi [I’m assuming

  • 0

If there are non-number characters in a string and you call atoi [I’m assuming wtoi will do the same]. How will atoi treat the string?

Lets say for an example I have the following strings:

  1. “20234543”
  2. “232B”
  3. “B”

I’m sure that 1 will return the integer 20234543. What I’m curious is if 2 will return “232.” [Thats what I need to solve my problem]. Also 3 should not return a value. Are these beliefs false? Also… if 2 does act as I believe, how does it handle the e character at the end of the string? [Thats typically used in exponential notation]

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T19:39:40+00:00Added an answer on May 15, 2026 at 7:39 pm

    You can test this sort of thing yourself. I copied the code from the Cplusplus reference site. It looks like your intuition about the first two examples are correct, but the third example returns ‘0’. ‘E’ and ‘e’ are treated just like ‘B’ is in the second example also.

    So the rules are

    On success, the function returns the converted integral number as an int value.
    If no valid conversion could be performed, a zero value is returned.
    If the correct value is out of the range of representable values, INT_MAX or INT_MIN is returned.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm building a non-javascript version of a website, as there are a number of
I'm using Membership.GeneratePassword(10, 0). i.e. Number of Non-AlphaNumeric characters should be zero, as per
Is there anything non-RESTful about providing parameters to a HTTP DELETE request? My scenario
Is there any non-hacky way to determine wether a class' superclass implements a particular
I know there are non-standard frameworks such as commons-validator, and hibernate validator. I wanted
There's always skepticism from non-programmers when honest developers learn the techniques of black hat
There are some ARIA tutorial websites use non-semantic markup and some javascript to demostrate
Is there a way to make a variable non-inheritable in python? Like in the
Is there a way for a non admin user to check the uptime of
Is there any way to make only a non-transparent portion of an image to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.