Answers for "How to convert decimal to hexa in cpp"

C++
0

int to hexadecimal in c++

#include <sstream>
std::stringstream sstream;
sstream << std::hex << my_integer;
std::string result = sstream.str();
Posted by: Guest on September-16-2020
-1

decimal to hex cpp

// Pretty stright forward
//  takes in input
//  outputs it in hex

#include <iostream>
using namespace std;

int main(){
        float i;
        cout << "What is the number?: ";
        cin  >> i;

        int* q = (int*)&i;
        cout << hex << *q << endl;

        return 0;
}
Posted by: Guest on June-29-2020

Code answers related to "How to convert decimal to hexa in cpp"

Browse Popular Code Answers by Language