Converting String to int results in 0x3f ?

  • Thread starter Thread starter John Bailo
  • Start date Start date
J

John Bailo

In Visual Studio.2003 I set up two command line arguments in the Project
Properties.

The arguments are

XFER 63

Written just like that.

If I example the value of args[1] it shows its equal to 63. Now I want
to capture that value in an int. So I do this:

int TransferID = Convert.ToInt32(args[1].ToString());


However, the value of TransferID ends up being 0x3f

Why?
 
Now that I look at it, it seems the debugger presents all the values of
int's as hex values.

Is that an application setting somewhere?

John said:
In Visual Studio.2003 I set up two command line arguments in the Project
Properties.

The arguments are

XFER 63

Written just like that.

If I example the value of args[1] it shows its equal to 63. Now I want
to capture that value in an int. So I do this:

int TransferID = Convert.ToInt32(args[1].ToString());


However, the value of TransferID ends up being 0x3f

Why?
 
Yes

In the options somewhere,

Cor

John Bailo said:
Now that I look at it, it seems the debugger presents all the values of
int's as hex values.

Is that an application setting somewhere?

John said:
In Visual Studio.2003 I set up two command line arguments in the Project
Properties.

The arguments are

XFER 63

Written just like that.

If I example the value of args[1] it shows its equal to 63. Now I want
to capture that value in an int. So I do this:

int TransferID = Convert.ToInt32(args[1].ToString());


However, the value of TransferID ends up being 0x3f

Why?
 
Now that I look at it, it seems the debugger presents all the values of
int's as hex values.

Is that an application setting somewhere?

Just right click the watch window and de-select the hexadecimal display
option.
 
Thanks, there was a 'Hex' button in my Dev toolbar.

Must have inadvertently clicked it!
 
Back
Top