I need to convert a decimal number into a hexadecimal number with "0x" beforehand as the program I am writing needs to be able to create a bitmap image by writing in each hex value. I have written th
My current code is shown below.
#include <stdio.h> #include <math.h>
void decToHex(int decimal);
char bitCode[4]="0x";
int main (int argc, const char * argv[]) { decToHex(254); puts(bitCode); return 0; }
It does and it can... I took an i3 board and upgraded it to my FX8350... no issues, just put in new drivers over the top that Windows didn't.
Not the issue for me, (though I eventually did do a new install from 23H2 to 24H2)... I was on 22H2 at the time.
The issue is activation. You may get hit with having to activate again.
Question
~Matt~
I need to convert a decimal number into a hexadecimal number with "0x" beforehand as the program I am writing needs to be able to create a bitmap image by writing in each hex value. I have written th
My current code is shown below.
However when I want to put my bitCode into an array as follows:
unsigned char drawing[]={bitCode,bitCode,bitCode};
[/CODE]
I get an error that says:[b]incompatible pointer to integer conversion initializing 'unsigned char' with an expression of type char[4][/b]
I think i need to somehow convert it to a string to work. Please tell me what i am doing wrong!
Link to comment
https://www.neowin.net/forum/topic/1068922-c-decimal-to-hexadecimal-conversion-as-string-help/Share on other sites
3 answers to this question
Recommended Posts