Hi everyone.
I have a very simple question about converting strings(in hex) into signed integer number.
I use strtol, but it does not work at all.


char code[]="FFFFFFFF";
int m;

m=strtol(code,NULL,16);
printf("%d\n",m);


but the result is not -1

How can I manage this in C?
Best regards.

Recommended Answers

All 2 Replies

Did you hit your head and get amnesia or something? I answered all parts of this exact question in the only other thread you've posted on Daniweb.

I got amnesia about I solved this problem. And luckily recovered:)

Thanks. I did not want you to be upset.
Cheers.

Be a part of the DaniWeb community

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