11043 - Fast and Easy Data Compressor

All about problems in Volume 110. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Post Reply
SRX
Learning poster
Posts: 63
Joined: Sat May 14, 2005 8:13 am
Location: Taiwan

11043 - Fast and Easy Data Compressor

Post by SRX »

I ' m getting RunTimeError .

Can someone give me some test cases ?
btw , what is " carriage return"
thanks :D
studying @ ntu csie

Emilio
Experienced poster
Posts: 163
Joined: Sun Oct 17, 2004 8:31 pm
Location: Murcia, Spain

Post by Emilio »

Your runtime error can be due to the fact that you are using char instead of unsigned char.
Btw, Carriage return is '\n' like.

SRX
Learning poster
Posts: 63
Joined: Sat May 14, 2005 8:13 am
Location: Taiwan

Post by SRX »

Emilio wrote:Your runtime error can be due to the fact that you are using char instead of unsigned char.
Btw, Carriage return is '\n' like.
I have got ac
thanks to Emilio
your hint make me think about negtive value :P
hello , why char 's value can be negtive ?
how does judge input char with negtive ascii value ?
studying @ ntu csie

helloneo
Guru
Posts: 516
Joined: Mon Jul 04, 2005 6:30 am
Location: Seoul, Korea

Post by helloneo »

SRX wrote:
Emilio wrote:Your runtime error can be due to the fact that you are using char instead of unsigned char.
Btw, Carriage return is '\n' like.
I have got ac
thanks to Emilio
your hint make me think about negtive value :P
hello , why char 's value can be negtive ?
how does judge input char with negtive ascii value ?
There are many special characters or language characters other than alphabet ..
They consist of 2 bytes and each value is above 128 ..
That's why you got negative ascii value (I guess :) )

Emilio
Experienced poster
Posts: 163
Joined: Sun Oct 17, 2004 8:31 pm
Location: Murcia, Spain

Post by Emilio »

The reason is that chars value can be from 0 to 255, if you have a signed char when the value is greater than 127 the last bit will be a 1, and this will be seen as a negative value because this bit is the bit for the sign, thus, with an unsigned char this value is seen as a positive value.

Sotek
New poster
Posts: 8
Joined: Mon Jun 05, 2006 12:06 am
Location: Murcia, Spain

Post by Sotek »

The problem with signed char is due to a special spanish character used in the input whose value is greater than 127.

This is the character: Image

Post Reply

Return to “Volume 110 (11000-11099)”