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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T11:54:32+00:00 2026-05-20T11:54:32+00:00

When I try to run the following code it always spits out the hex

  • 0

When I try to run the following code it always spits out the hex representation, not the integer representation. Most of the examples I found on MSDN said this should work. What am I missing?

                var stringBuilder = new StringBuilder("8");
                int j = 0;
                foreach (char item in stringBuilder.ToString())
                {
                    j = Convert.ToInt32(item); //returns 38, need return to be 56
                }

edit
I should have made clear that I know the difference it’s returning the hex value. I’m outputting the value to a file, and in that file, it still shows the hex value, not the integer, so I don’t think it has anything to do with the debugging environment.

edit2 Looks like a PEBKAC problem. Looked at the code that was writing to the file, and it was using a .toString(“X”) method, changing it to a Hex value. The fact that it was hex in my debug environment was what confused me.

  • 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-20T11:54:32+00:00Added an answer on May 20, 2026 at 11:54 am

    An int is neither hex nor decimal. It’s just a number. Is your debugger set to display hex-values for ints?

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

Sidebar

Related Questions

I try to run the following code: public void Init(Url rootUrl) { var web
When I try to run the following code from the REPL (playing with dynamic
When I try to run a routine I get the following error: Error Code:
I try to run the following raw query in android, it seems not work
if i try to run following code in sql server 2005 i get error
When I try to run the following code in the MySQL console it gives
When I try to run the following code (from the REPL) in Clojure: (dotimes
When I try to run the following SQL snippet inside a cursor loop, set
When I try to run the following, I get an error back from ActiveRecord
I try to run jsf application in myeclipse using jboss web server and following

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.