G
grahamo
Hi,
i know I should use the new style casts and I intend to however I
would like to know how I go about this;
I have an unsigned char* that a 3rd party API returned to me. The API
reads text from a file and gives me that test as an unsigned char*.
For the sake of this example the text string is "100"
unsigned char* data = foo();
I need to get this into an unsigned int, which is what it ultimately
should be however I'm not sure of the best approach. I can cast it to
a char* and then use sprintf(result, "%d", arg) but I'm not sure if
thats the best approach.
What's the *correct* way to achieve it... in terms of code correctness
and "correct approach".
Thanks much for any info (as usual
GrahamO
i know I should use the new style casts and I intend to however I
would like to know how I go about this;
I have an unsigned char* that a 3rd party API returned to me. The API
reads text from a file and gives me that test as an unsigned char*.
For the sake of this example the text string is "100"
unsigned char* data = foo();
I need to get this into an unsigned int, which is what it ultimately
should be however I'm not sure of the best approach. I can cast it to
a char* and then use sprintf(result, "%d", arg) but I'm not sure if
thats the best approach.
What's the *correct* way to achieve it... in terms of code correctness
and "correct approach".
Thanks much for any info (as usual
GrahamO