|
-
Apr 25th, 2021, 11:52 AM
#8
Re: How to convert a HEX array to DEC ???
The 'c' is saying that " " is a character rather than a string. Those are two different types. You are creating an array of Char, so it can only take items of type Char. Without the 'c', then anything inside quotes will be a string, regardless of whether or not it is just a single character long.
Did you look at the link I provided? The various Convert.ToInteger variants normally convert strings to integers, but they assume that the string they are trying to convert is a base 10 representation of the integer. In your case, the string they are trying to convert is a base 16 representation of the integer, so you have to use a variation of Convert.ToInteger to tell the computer that, which is what the link shows.
I haven't looked to see whether there is a similar overload of Convert.ToInt16. There probably is, but there isn't much point in converting to an Int16....ever. You'd only really use that in certain rare embedded systems, as far as I can tell.
My usual boring signature: Nothing
 
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|