Hola aguml.
Cita:
Empezado por aguml
... ademas sscanf siempre me retorna 0 en la variable de 64 bits.
|
Por eso que comentas, entiendo que tu problema es leer el valor hexadecimal como string y luego operar con él.
Un ejemplo de como leer como string, convertirlo a hexa y operar con él:
Código PHP:
#include <iostream>
#include <sstream>
int main() {
std::stringstream ss;
unsigned long long auxDivisor;
std::string divisor;
// leer string
std::cin >> divisor;
// pasar como hexa a auxDivisor
std::istringstream(divisor) >> std::hex >> auxDivisor;
// auxDivisor / 2
auxDivisor >>= 1;
// mostrar
std::cout << std::hex << auxDivisor;
return 0;
}
Saludos