Re: sscanf in c#
- From: "Willy Denoyette [MVP]" <willy.denoyette@xxxxxxxxxx>
- Date: Wed, 20 Sep 2006 00:13:22 +0200
"AMP" <ampeloso@xxxxxxxxx> wrote in message
news:1158700185.489264.165290@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
| Hello,
| I am the OP.
| I am beginning to understand but I have the following:
| sscanf(strdata[1], "%lx\n", currentAddr);
|
| currentAddr is an unsigned long in c(which is a uint in c#) 4 bytes,
| correct?
Yep.
| I am trying to get the hang of this, but I could use an example with
| something I'm using.
as per my previous sample...
uint currentAddr;
string strData = " ff12fffe ";
bool result = UInt32.TryParse(strData.SubString(1), NumberStyles.HexNumber,
null, out currentAddr);
if(result)
// parsed correctly.
else
// failed to parse.
or, you can use the Parse method.
try {
hexVal = UInt32.Parse(installResult.Substring(1),
NumberStyles.HexNumber);
}
Willy.
.
- References:
- sscanf in c#
- From: AMP
- Re: sscanf in c#
- From: Willy Denoyette [MVP]
- Re: sscanf in c#
- From: Mythran
- Re: sscanf in c#
- From: Willy Denoyette [MVP]
- Re: sscanf in c#
- From: Mythran
- Re: sscanf in c#
- From: Willy Denoyette [MVP]
- Re: sscanf in c#
- From: Mythran
- Re: sscanf in c#
- From: AMP
- sscanf in c#
- Prev by Date: Re: sscanf in c#
- Next by Date: Re: sscanf in c#
- Previous by thread: Re: sscanf in c#
- Next by thread: Binding object method to Dataview.. Not understanding List<GENERIC> ..
- Index(es):