--- In [email protected], "abcpqr70" <abcpq...@...> wrote:
>
> --- In [email protected], Stephane Lesoinne <lesoinne@> wrote:
> >
> > 
> > If you want to convert a string representation of a number to his 
> > integer equivalent, you'll have to use the atoi(...) function.
> > 
> 
> yeah!
> even i have same views!

But if you read the original post:

"so im currently try to read a binary file and try to represent it in rgb 
image. i save the file into char[length] and then try to convert it to int to 
get 0-255 value."

I don't think the OP is reading string representations of numbers. He is just 
reading 'raw' byte values as chars, and wants to convert them into ints. But 
because (we suspect) his char type is signed, values 128..255 end up as int 
values -128..-1.

If this is correct, then using atoi() would not solve his problem.

John


Reply via email to