Probleme avec istringstream
Bonjour à tous, j'ai un problème avec le code suivant :
#include <sstream>
#include <iostream>
#include <stdint.h>
using namespace std;
int main(int argc, char ** argv)
{
string s("endor ID Low Byte");
istringstream iss;
uint32_t tmp;
iss.str( s );
if ( !(iss >> hex >> tmp) )
{
return ( false );
}
cout << tmp << endl;
return ( true );
}
Pour ce code, "endor ID Low Byte" est une représentation hexadécimal de
14... Quelqu'un peut-il me dire ce que je fais pas bien?
Merci d'avance!
|