That's because you're trying to convert the pointer itself instead of the value that it points to. Use the * (dereferrence) operator to get the value.