Go Down

Topic: STRING To HEX Converter (Read 26761 times) previous topic - next topic

Shruty19

Also is there any way to left zero pad in string?

PaulS

Code: [Select]
       ret = strtoul(nes, &ptr, 16);       
The strtoul() function does not take a String.

Quote
Also is there any way to left zero pad in string?
Yes.

You post code that won't compile. You don't show what is in the String instances. You don't show the output. ALL you do is whine "it doesn't work".

I'm convinced that you don't want help.
The art of getting good answers lies in asking good questions.

TolpuddleSartre

nes is a String, but strtoul expects a char array.
That's why you get an eror.
The String class has a method to turn Strings into strings.

Or, you could cut out the middleman, and not bother using Strings in the first place.

Go Up