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

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Apr 2007
Posts: 17
Reputation: MukeshZ is an unknown quantity at this point 
Solved Threads: 0
MukeshZ MukeshZ is offline Offline
Newbie Poster

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

 
0
  #1
Apr 18th, 2007
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
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,398
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1466
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

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

 
0
  #2
Apr 18th, 2007
>>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.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Join Date: Apr 2007
Posts: 17
Reputation: MukeshZ is an unknown quantity at this point 
Solved Threads: 0
MukeshZ MukeshZ is offline Offline
Newbie Poster

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

 
0
  #3
Apr 18th, 2007
Originally Posted by Ancient Dragon View Post
>>in c++ or VC++

VC++ is a compiler, not a computer language.
I need it in Visual C++ project or in simple c++
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,398
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1466
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

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

 
0
  #4
Apr 18th, 2007
see my previous answer -- it contains a link
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Join Date: Apr 2007
Posts: 17
Reputation: MukeshZ is an unknown quantity at this point 
Solved Threads: 0
MukeshZ MukeshZ is offline Offline
Newbie Poster

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

 
0
  #5
Apr 18th, 2007
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.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC