Confusing error ?!?!
From: dwaonng (dwaonng1234_at_yahoo.com)
Date: 02/28/04
- Next message: Alf P. Steinbach: "Re: Confusing error ?!?!"
- Previous message: Mark A. Gibbs: "Re: back_inserter & basic_string"
- Next in thread: Alf P. Steinbach: "Re: Confusing error ?!?!"
- Reply: Alf P. Steinbach: "Re: Confusing error ?!?!"
- Reply: Poiquiop: "socket programming"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 28 Feb 2004 15:00:32 -0600
im working on a prgm to do LZW compression
In a file I stored a character with the code: 26(binary:00011010) when I try to retreive the code from the file I get the int value -1 and(binary:11111111111111111111111111111111), why is that!??! Is it possible to get the character code 26 back from the file it was stored in?
I know the character value is 26 definitely but using getc() doesnt give me the correct value back. Also that the character code 26 represents SUB (no idea).
#include <iostream.h>
#include <stdio.h>
void main()
{
FILE *input=fopen("1.txt","r");
cout << "\n(getc(input): " << (int) getc(input);
fclose(input);
}
- Next message: Alf P. Steinbach: "Re: Confusing error ?!?!"
- Previous message: Mark A. Gibbs: "Re: back_inserter & basic_string"
- Next in thread: Alf P. Steinbach: "Re: Confusing error ?!?!"
- Reply: Alf P. Steinbach: "Re: Confusing error ?!?!"
- Reply: Poiquiop: "socket programming"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]