a simple question, i just can't get around at the moment - if i may

if unsigned char *s = 42006f, how can I split/select the hex value into its pairs i.e 42/00/6f

using portable ansi c.

thanks!!

Recommended Answers

I already answered this in the other thread in which you asked the same question.

Jump to Post

All 3 Replies

I already answered this in the other thread in which you asked the same question.

Sorry I didn't see that, I was previously asking to count the amount, not the actual values.

Heres a bit of pseudo of what I'd like

unsigned char *s;
scanf("%x", &s);
Type in 42006f for example

I'd like
s1=42
s2=00
s3=6f

How'd I get that?

What is it with you guys???? I said I already answered it. And you asked it again! Look at the damn answer from 2 days ago!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.