List:MySQL++« Previous MessageNext Message »
From:Warren Young Date:September 19 2008 12:23pm
Subject:Re: Trouble with datatype 'TIME'
View as plain text  
On Sep 19, 2008, at 2:01 AM, lists@stripped wrote:

> cout << tt.hour() << ":" << tt.minute() << ":" <<
> tt.second() << endl;
>
> hour(), minute() and second() are delivering unsigned char's

Yes, so you want your output statement to be:

> cout << int(tt.hour()) << ":" << int(tt.minute()) << ":"
> <<  
> int(tt.second()) << endl;

IOstream treats characters as ASCII characters, not as 8-bit integers.
Thread
Trouble with datatype 'TIME'lists19 Sep
RE: Trouble with datatype 'TIME'lists19 Sep
  • Re: Trouble with datatype 'TIME'Warren Young19 Sep