Re: [Dev-C++] what's wrong with code or answer
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: <or...@vp...> - 2003-06-16 06:58:12
|
dawood wrote:
> why the code below is giving me numbers in hex in both the case.
>
>
> *#include <iostream.h>
> #include <stdlib.h>
>
> int main()
> {
> for(char ch = 0;ch<=125;ch++)
> cout<<"int value of char "<<ch<<" in decimal is "<<int(ch)<<"
> and in hexadeciamal is "<<hex<<int(ch)<<'\n';
>
> return 0;
> }
>
>
> Can anyone explain me*
Try putting "dec" before the second output, just like "hex" at the end,
like:
/*...*/ <<dec<<int(ch)<< /*...*/
--
Regards,
Balázs
|