Sounds to me like you have a string representation of a binary number, e.g. "10010101", and you need to convert this to either an decimal integer (or a string representation of one).
Either way, it sounds like a homework assignment to me, so you should double check with your teacher and/or school to verify that it's okay for you to get help from these forums. Most schools/teachers restrict the places a student is allowed to get help for solving programming problems.
Take care,
Nik
http://www.bigaction.org/