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 6608413
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:36:25+00:00 2026-05-25T19:36:25+00:00

I am just beginning to learn C#. I am reading a book and one

  • 0

I am just beginning to learn C#. I am reading a book and one of the examples is this:

using System;

public class Example
{
    public static void Main()
    {
        string myInput;
        int myInt;

        Console.Write("Please enter a number: ");
        myInput = Console.ReadLine();
        myInt = Int32.Parse(myInput);

        Console.WriteLine(myInt);
        Console.ReadLine();
    }
}

When i run that and enter say ‘five’ and hit return, i get ‘input string not in correct format’ error. The thing i don’t understand is, i converted the string myInput to a number didn’t i? Microsoft says that In32.Parse ‘Converts the string representation of a number to its 32-bit signed integer equivalent.’ So how come it doesn’t work when i type the word five? It should be converted to an integer shouldn’t it… confused. Thanks for advice.

  • 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-25T19:36:25+00:00Added an answer on May 25, 2026 at 7:36 pm

    The words representing a number aren’t converted; it converts the characters that represent numbers into actual numbers.

    “5” in a string is stored in memory as the ASCII (or unicode) character representation of a 5. The ASCII for a 5 is 0x35 (hex) or 53 (decimal). An integer with the value ‘5’ is stored in memory as an actual 5, i.e. 0101 binary.

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

Sidebar

Related Questions

I'm just beginning to learn python. I wrote an example script to test OOP
I am just beginning to learn Matlab , so this question might be very
I am new to linux, and just beginning to learn bash. I am using
Just beginning to learn about structs, I thought I understood how they work, using
I'm just beginning to learn C++ and I'm trying to make Thread class that
We are just beginning to learn and evaluate Mercurial, due to an increasing number
I am just beginning to learn VHDL in modelsim, so i apologize in advance
I am just beginning to do research into the feasibility of using Amazon's SimpleDB
I am just beginning to learn about accessbility specifically in relation to JAWS -
I'm just curious as I am beginning to learn PHP and MySQL, as 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.