Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   C++ (http://www.velocityreviews.com/forums/f39-c.html)
-   -   can u help me , what the output will be (http://www.velocityreviews.com/forums/t459984-can-u-help-me-what-the-output-will-be.html)

 yogesh 01-23-2007 05:27 AM

can u help me , what the output will be

char TCGI::x2c(char *what)
{
register char digit;
digit = (char) ((what[0] >= 'A' ? ((what[0] & 0xdf) - 'A')+10 :
(what[0] - '0')));
digit *= (char) 16;
digit += (char) ((what[1] >= 'A' ? ((what[1] & 0xdf) - 'A')+10 :
(what[1] - '0')));
return(digit);
}

what the operation is used for , what it will return the value ,

 Alf P. Steinbach 01-23-2007 05:36 AM

Re: can u help me , what the output will be

* yogesh:
> char TCGI::x2c(char *what)
> {
> register char digit;
> digit = (char) ((what[0] >= 'A' ? ((what[0] & 0xdf) - 'A')+10 :
> (what[0] - '0')));
> digit *= (char) 16;
> digit += (char) ((what[1] >= 'A' ? ((what[1] & 0xdf) - 'A')+10 :
> (what[1] - '0')));
> return(digit);
> }
>
>
> what the operation is used for , what it will return the value ,

You have posted the same article /separately/ to alt.comp.lang.learn.c-c++.

Don't.

Multi-post.

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?

 Ian Collins 01-23-2007 06:40 AM

Re: can u help me , what the output will be

Alf P. Steinbach wrote:
> * yogesh:
>
>> char TCGI::x2c(char *what)
>> {
>> register char digit;
>> digit = (char) ((what[0] >= 'A' ? ((what[0] & 0xdf) - 'A')+10 :
>> (what[0] - '0')));
>> digit *= (char) 16;
>> digit += (char) ((what[1] >= 'A' ? ((what[1] & 0xdf) - 'A')+10 :
>> (what[1] - '0')));
>> return(digit);
>> }
>>
>>
>> what the operation is used for , what it will return the value ,

>
>
> You have posted the same article /separately/ to alt.comp.lang.learn.c-c++.
>
> Don't.
>
> Multi-post.
>