Thats actually not a problem because char can be implicitly casted to int. They are both integer types, only the size is different and since int is bigger than char there's no type problem with the cast and the compiler does it automatically. There could be a signed/unsigned issue, but I think in most cases char and int are both signed by default, and at worst the compiler will issue a warning and still do the implicit cast.
Your problem is with the inner for loop in the function call. You don't need a loop there at all. Just initialize j to 0 before entering the (outer) loop, and when there's a successful test of cInputOld[i], assign to iBinary[j] and increment j, unless you're trying to do something other than what I'm thinking. Also, you should initialize the iBinary array or only print the values that were actually stored.
Last edited by n0nsensical; 12-01-2006 at 12:53 PM..
|