--- In [email protected], Paul Herring <pauljherr...@...> wrote: > > On Wed, May 6, 2009 at 10:59 AM, Jos Timanta Tarigan > <jos_t_tari...@...> wrote: > > > > hi, > > > > 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. is it ok to do it > > explicitly eg. (int)thisChar ? > > In all likelihood, no. > > > i got an unexpected value and i wonder if that caused by it. > > If by unexpected you mean negative you perhaps need an array of > > unsigned char [length]; > > instead of > > char[length]; > > Also check that you're opening the file for binary reads (as opposed > to text or 'default' which is text on some systems.) > > Otherwise you're going to have to explain a bit more. > > -- > PJH > > http://shabbleland.myminicity.com/com > http://www.chavgangs.com/register.php?referer=9375 > and i hope this ASCI value is the unexpected value you were talking about
- [c-prog] explicit cast from char to int? Jos Timanta Tarigan
- Re: [c-prog] explicit cast from char to int? Paul Herring
- Re: [c-prog] explicit cast from char to int? Raja
- Re: [c-prog] explicit cast from char to i... Paul Herring
- Re: [c-prog] explicit cast from char to int? Stephane Lesoinne
- Re: [c-prog] explicit cast from char to i... Paul Herring
- [c-prog] Re: explicit cast from char to i... abcpqr70
- [c-prog] Re: explicit cast from char ... John Matthews
- [c-prog] Re: explicit cast from char ... Saurabh Jain
- [c-prog] Re: explicit cast from char to int? abcpqr70
- [c-prog] Re: explicit cast from char to int? abcpqr70
- Re: [c-prog] Re: explicit cast from char ... Paul Herring
- Re: [c-prog] Re: explicit cast from c... Brett McCoy
- Re: [c-prog] Re: explicit cast f... Rick
- Re: [c-prog] Re: explicit ca... Paul Herring
- Where's Victor? (was Re:... Rick
- Re: Where's Victor? (was... Thomas Hruska
- [c-prog] Re: explicit cast from char ... abcpqr70
- Re: [c-prog] explicit cast from char to int? Paul Herring
- [c-prog] Re: explicit cast from char to int? John Matthews
