Thread: conversion
View Single Post
  #1 (permalink)  
Old March 16th, 2004, 09:26 AM
gbilios gbilios is offline
Authorized User
 
Join Date: Mar 2004
Posts: 33
Thanks: 0
Thanked 1 Time in 1 Post
Default conversion

I am writing code to convert a negative binary number to its positive counterpart. The code below doesn't do the conversion properley. Can anyone please help??

#define SIZE 8
void Converter(int binary[])
{
int num[SIZE];

for(count = SIZE - 1; count >= 0; cout--)
{
  if(binary[0] = '1'); // is negative
   sum[count] = 0; // this making everything to zero
} // end for
}



George N. Bilios
__________________
gbilios
Reply With Quote