Hey Joe 
Author Message
 Hey Joe

Can you tell me how to get c++ to print a character in it's binary form?

We are doing a assignment where we are doing bite minipulation and it
would be great to see the binary form.

thanks Ken



Wed, 26 Feb 2003 03:39:15 GMT  
 Hey Joe

Greets,

    Is this similar to that for which you are looking?

----------

#include <iostream>

int main(void)
{

    using std::cout;
    using std::endl;

    char* pString="abcd";

    for (char* pStart=pString; *pStart != '\0'; pStart++) {
        cout << static_cast<unsigned int>(*pStart) << endl;
    }
    return(0);

Quote:
}

Regards,

Joe

Quote:
> Can you tell me how to get c++ to print a character in it's binary form?

> We are doing a assignment where we are doing bite minipulation and it
> would be great to see the binary form.

> thanks Ken



Wed, 26 Feb 2003 03:52:23 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Joe job nomination

2. Joe job nomination 5808333085

3. Joe job nomination 4312744786

4. Joe Campbell's serial comm lib

5. Thanks Joe Delekto

6. Porting JOE

7. Q for Joe N. re property sheets

8. Thanks Joe, Scott, David, others

9. Hey MS, help me promote .NET !!!

10. Hey Will Rose

11. Hey, Learning is what its all about, look?

12. -- Hey, Is this normal?

 

 
Powered by phpBB® Forum Software