switch statement problem

i have code like this

char c = pkt_->data[3];
  switch (c)
  {
    case 0x03:
      ret="R";
      break;
    case 0xf6:
      ret="F";
      break;
     case 0xf7:
      ret="f";
      break;
     default:
     break;
}

while debugging i can see that value of c is 0xf7, but it is not going to execute that case statement and always going to default case. what could be the problem.
nrusinhAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jhanceCommented:
I'm concerned about your lines of the form:

ret="R";

what is ret?  If a char, then you are writing improper code.  It should be:

ret = 'R';
DanRollinsCommented:
That code should work.  
How do you know that it is failing?  
Does it work when c is 0x03?
What is your declaration for the variable 'ret' ?

-- Dan
nrusinhAuthor Commented:
it is not executing case 0xf7:

if i write case -9:, it works. but above code works on linux.
PMI ACP® Project Management

Prepare for the PMI Agile Certified Practitioner (PMI-ACP)® exam, which formally recognizes your knowledge of agile principles and your skill with agile techniques.

SteHCommented:
How about
unsigned char c

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
DanRollinsCommented:
I thought that was a pretty excellent answer.  Neither jhance nor myself thought of it immediately.  I wonder why nrusinh gave SteH a grade of C.
jhanceCommented:
>>unsigned char c
>> Points: 50   Grade: C

It seems there must be a connection here...
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C++

From novice to tech pro — start learning today.