Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 24th, 2005, 06:25 AM
Registered User
 
Join Date: Jun 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Strange conversion error

when i attempted to convert a char, EquationRightText[2], into an int, i got a weird error.
the char(part of a string) holds a number.but when i converted it into an int, this number increases in value by 48.
why does this happen and are there ways to rectify it besides subtracting 48 from it?


 
Old June 25th, 2005, 07:41 AM
Authorized User
 
Join Date: May 2004
Posts: 83
Thanks: 0
Thanked 1 Time in 1 Post
Default

How did you try to convert the char into int? May be using int.Parse() method helps. I'm not sure but may be the problem is with the char data type in your case. Try the same code with the string data type. We may be more useful if you show a snippet of your code that's evil.

Regards,

ejan
 
Old August 30th, 2005, 05:52 PM
pcd pcd is offline
Registered User
 
Join Date: Aug 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The Hex value of the CHARACTER '0' (Zero) is 0x30 or 48 decimal. You are using the wrong 'conversion' function. But given I don't know c# yet, I can't help you with the right function.

pcd





Similar Threads
Thread Thread Starter Forum Replies Last Post
An Strange Error alirezaaali Classic ASP Professional 1 August 16th, 2007 10:03 AM
Strange ERROR (?) myself Classic ASP Basics 16 June 22nd, 2006 06:39 AM
Strange Error !!! NinaWilliam ASP.NET 1.0 and 1.1 Basics 2 May 21st, 2006 01:34 AM
strange error dynamic_iiita Beginning PHP 0 May 22nd, 2005 06:14 AM
Strange error eraser Classic ASP Basics 3 September 21st, 2004 07:55 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.