I have a requirement, part of which needs conversion from decimal to hex.
I prefer the following way to do that thing as below:
sprintf(mcc,"%x",n);
n here will be an integer.
But my peer says it is not a good way to do that.
Instead he says to manually convert the decimal using a function,
but I did not get a good explanation about why not to use sprintf.
Are there any problems with the above method I am using?
Should I go for a function which manually converts the decimal number into hex?
As long as you make sure that the buffer pointed to by
mccis big enough for the resulting string, I see no problem.