[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [CPROG] Re: EOF i Windows




Emil Zeuthen skriver:
> 
> Goddag
> 
> Jeg fortsætter med mine kedelige spørgsmål ang. EOF i Windows. Jeg har fået
> tre svar på mit første brev, som jeg her vil spørge til.
> 
> Hvordan angiver man specifikt, at den fil man åbner er binær med C++? Linux
> skælner vist ikke binære- og tekstfiler, men det gør Windows, og det er det
> der er mit problem.
> ---ooo---
> Jeg får samme resultat med disse to metoder, de reagerer på ASCII 26 som End
> of file:
> c = finput.get();
> if(c == EOF) {...}
> &
> c = finput.get();
> if(finput.eof()) {...}
> 
> Så finput.eof() er vist ikke løsningen.
> ---ooo---
> Jeg bruger ikke DJGPP, men Mingw32. Jeg tror at jeg kan finde en nemmere
> måde at løse problemet på end at definere 3 EOF'er, men tak for forslaget.
> 

Det nemmeste er vist at bruge iostream.h og så udnytte IOS
spicificeringer i sine streams.


ifstream finput("FILIND.bin", IOS::binary);
while (!finput.eof) {
c=finput.get;
};


-
 MVH
   Kim schulz
========================================================================
|                 ADICT Kode Slave - www.adict.net                     |
|            Dansk Linux Link Database - www.LinuXia.dk                |
========================================================================
              Sleep is just a cheap substitute for coffee     
     Fast, reliable, cheap - pick any two - [Microsoft in a Nutshell]


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:08 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *