"Delali Dzirasa" <(E-Mail Removed)> wrote in message news:<bjnph7$j8p$(E-Mail Removed)>...

> Does anyone know of the fastest way to convert a CString of numbers ie

> "00000001" to the binary representation in an int?

>

> for example

>

> CString myVal = "00000001";

>

> int myIntVal = 0;

>

> myIntVal = CStringToBinary(myVal);

> where the "CStringToBinary" function is what I am looking to find.

>

> the int representation should be 1 or in hex 0x01

> Any help is greatly appreciated.

>

> Delali
int myIntVal = 0;

const char* ptr = myVal;

while (*ptr)

myIntVal += myIntVal + (*ptr++ - '0');

Of course that only works for binary numbers