i am unable to read from a file having 26ascii character(ctrl+z) 
Author Message
 i am unable to read from a file having 26ascii character(ctrl+z)

in writing a program,i am storing values in a file in binary mode,
   when i store 26, it's storing well. but when i am reading from the file,
   it is returning eof(-1) as ascii26 represents ctrl+z

   could any one plz give me a legitimate solution.



Sat, 05 Feb 2005 17:09:26 GMT  
 i am unable to read from a file having 26ascii character(ctrl+z)

Quote:
> in writing a program,i am storing values in a file in binary mode,
>    when i store 26, it's storing well. but when i am reading from the file,
>    it is returning eof(-1) as ascii26 represents ctrl+z
>    could any one plz give me a legitimate solution.

Are you opening the file in text mode with fopen("filename", "r")? Open
it in binary mode instead with fopen("filename", "rb"). This stops your
implementation from assigning special meaning to the character 26.

--

| Kingpriest of "The Flying Lemon Tree" G++ FR FW+ M- #108 D+ ADA N+++|
| http://www.helsinki.fi/~palaste       W++ B OP+                     |
\----------------------------------------- Finland rules! ------------/
"Keep shooting, sooner or later you're bound to hit something."
   - Misfire



Sat, 05 Feb 2005 17:13:10 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. I am having problems with MFC42.dll file

2. I am having with my bishop

3. I am having troubles with the switch()

4. HELP, I am having problems with pointer...

5. I am having probability d

6. I am having probability difficulties...HELP

7. I am having problems setting up that a specified dialog is displayed before any others

8. Reading Extended Ascii characters from a file - bug?

9. Problems trying to read character #152 (?) from file

10. Reading characters from file

11. reading previous character from FILE

12. Problem: reading characters from a file

 

 
Powered by phpBB® Forum Software