title: Converting from int to binary string to int using 2's complement
body: <p>There is a binary string <code>10001110</code> which I know is using 2's complement. I know it will be 8 bits.</p>
  
  <p>It is given to me in the form of an <code>unsigned int</code> which equals 142.</p>
  
  <p>I then need to convert this back to <code>10001110</code></p>
  
  <p>then invert all the bits and add one resulting in it equaling <code>01110010</code></p>
  
  <p>and then convert this to a <code>signed int</code> equaling -114.</p>
  
  <p>How can I do this? I'm relatively new to C and have spent ages trying to figure it out!</p>
  
  <p>Essentially I want to write a function that takes the <code>unsigned int</code> 142 and returns the <code>signed int</code> -114</p>