How to assign a hexa value to int variable | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 1

How to assign a hexa value to int variable

I want to assign int variable a 256 value in hexadecimal

3rd Mar 2017, 11:26 AM
suraj pandey
suraj pandey - avatar
2 Réponses
+ 1
@akub thnx
4th Mar 2017, 2:09 AM
suraj pandey
suraj pandey - avatar
0
int a = 0x(insert your hex here) If you are lazy and want to output some dec to hex I'd recommend using std::hex: std::cout<< std::hex << 70;
3rd Mar 2017, 2:35 PM
Jakub Stasiak
Jakub Stasiak - avatar