does anyone have any sample code (c++) or can anyone teach me how to do this? part of this project is basically to read an input file (that the user specifies) and output it in binary using 2's complement...basically thanks

just the entire thing...he gave us this ridiculouse assignment and nobody has learned 2's complement yet...i get the general idea but i have no idea how to code it...i did a few searches but couldn't come up with any like example c++ code...that would help me the most

You have to convert an integer input to a string output of 1's and 0's? You should just be able to use shift and bitwise operations to achieve that: while ($input) { $bit = $input >> 1; if ($bit) print "1"; else print "0"; } That's just pseudo code of how to do it. Then obviously to convert to two's complement just invert and add 1 to the result.