Click here to Skip to main content
15,891,976 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
if (tlv_tag_compare(tags.pTagID, "\x9F\x91\x8B\x15"))
{

uint8 *ptr = tags.pTagID;
uint8 ch[4];
uint8 k=0;
for(k=0; k<=3;k++)
{
ch[k]=*ptr;
++ptr;
}
uint8 temp[4];
sprintf(temp,"%02x%02x%02x%02x",ch[0],ch[1],ch[2],ch[3]);

i m trying to examine the value of pTagID and I shoudl be getting 9F 91 8B 15
what i m getting in temp id different


can anyone tell me what is not correct?

pTag IS is a uint8 const*
Posted
Comments
Sergey Alexandrovich Kryukov 19-Sep-14 0:08am    
What, without seeing the definition of tags, tlv_tag_compare and probably something else? Can you concentrate of seeing your information by the eyes of the person how never saw anything related to the project except your post? Then it should become apparent for you what to put in the question post.
—SA

1 solution

Why bother with that conversion? The *printf family include a conversion meant for displaying pointers. %p
Check your documentation. Most implementations will print it as an address-size hex number.
 
Share this answer
 
Comments
George Jonsson 19-Sep-14 1:01am    
It seems that reading the documentation is very difficult these days.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900