944,010 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 7749
  • C++ RSS
Apr 18th, 2007
0

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

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
MukeshZ is offline Offline
17 posts
since Apr 2007
Apr 18th, 2007
0

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

>>in c++ or VC++

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

found this with google
Last edited by Ancient Dragon; Apr 18th, 2007 at 6:30 am.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,953 posts
since Aug 2005
Apr 18th, 2007
0

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

>>in c++ or VC++

VC++ is a compiler, not a computer language.
I need it in Visual C++ project or in simple c++
Reputation Points: 10
Solved Threads: 0
Newbie Poster
MukeshZ is offline Offline
17 posts
since Apr 2007
Apr 18th, 2007
0

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

see my previous answer -- it contains a link
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,953 posts
since Aug 2005
Apr 18th, 2007
0

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

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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
MukeshZ is offline Offline
17 posts
since Apr 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: problems in making loops
Next Thread in C++ Forum Timeline: questionaaire about tv watching habits





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC