954,206 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

2's complement of BYTE array in c++ or vc++

Hi,
I want to calculate 2's complement [ Negate all bits + 1] of BYTE array in c++ or VC++
firstly i am adding all elements of BYTE array and assigning it to integer variable now i want to calculate 2's complement of it. How can i do this plz help...
Does anyone know how to convert BYTE to binary format?

Thanks
Mukesh:)

MukeshZ
Newbie Poster
17 posts since Apr 2007
Reputation Points: 10
Solved Threads: 0
 

>>in c++ or VC++

VC++ is a compiler, not a computer language.

found this with google

Ancient Dragon
Retired & Loving It
Team Colleague
30,046 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,342
 

>>in c++ or VC++

VC++ is a compiler, not a computer language.


I need it in Visual C++ project or in simple c++

MukeshZ
Newbie Poster
17 posts since Apr 2007
Reputation Points: 10
Solved Threads: 0
 

see my previous answer -- it contains a link

Ancient Dragon
Retired & Loving It
Team Colleague
30,046 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,342
 

Thanks.
can we split the bits of byte data variable. what should i used for it... means which datatype to store the values
like A2 in hex as
162 in Dec

A2 in Binary
1010 0010

I want first 6 bit in one variable and last two in other. can i use shift operator? but how to use with bit ? plz help

Thanks again.

MukeshZ
Newbie Poster
17 posts since Apr 2007
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You