Question: String decimal_to_hex(int input) { char output[] = 00000000000000000000000000000000; String hex,tmp; char a; int b=0; for (int d = 31; d >= 0; --d) { int

String decimal_to_hex(int input) { char output[] = "00000000000000000000000000000000"; String hex,tmp; char a; int b=0; for (int d = 31; d >= 0; --d) { int a=input>>d; if (a&1) output[b]='1'; else output[b]='0'; b++; } String str(output); for (int i=0;iString decimal_to_hex(int input) { char output[] = "00000000000000000000000000000000"; String hex,tmp; char a;I write a program to convert a binary string to hex. It works perfectly on C++, but I do not know how it doesn't work on Arduino.

C++ shell 4 using namespace std; 5 int main() 6 { int input-1538595053 7char output"0000000000000000000800000000000"; 8 string hex,tmp; char a; int b-0 10 for (int d = 31; d )s 0;-d) f int a-input>>d; 12 13 14 15 16 string str(output); 17 for (int i-0;1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!