[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] EOF i Windows



Hej Emil

Du bruger DJGPP??? - et ikke helt tosset valg.

I Windoes er den underliggende datatype for "descriptorer" unsigned int (sic!)!!

(de kalder den vist også for pascal far out)
(i mods. til int under Linux)

Derfor kan makroen EOF der definitorisk er lig '-1' ikke bruges.

Som eksempel kan jeg nævne at ved brug af Winsock er det nødvendigt med 3
forskellige konstanter for at representere EOF.

Mit bedste forslag er derfor at du tjekker hvilke EOF'er Windoes returnerer i
hvilke situationer.

Hej fra Nils

Emil Zeuthen wrote:

> Goddag
>
> Jeg har et meget underligt problem i et C++ program jeg sysler med for
> tiden. Programet kigger bl.a. en fil igennem som skitseret her:
>
>   signed long int c = 0;        // 4 byte stor i Win
>   ifstream finput(input, ios::in);
>
>   while (1)
>   {
>
>     c = finput.get();
>
>     if (c==EOF)
>     {
>       .....
>       .....
>     }
>     else
>     {
>       ...
>       ...
>     }
>   }
>
> Det skulle der vidst ikke være noget galt med, hvilket der heller ikke er
> når jeg oversætter koden under Linux. Jeg ved godt dette er en Linux-C liste
> men alligevel drister jeg mig til at spørge: Hvorfor reagerer dette program
> på ASCII-tegn 26 som EOF, når jeg oversætter det i Windåsen? EOF er en int
> (4 byte stor). Jeg tror ikke at det er en compiler-bug, da jeg har prøvet
> med flere forskellige (med samme resultat).
>
> Mvh.
> Emil Zeuthen
> ---- -------
> ________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com



 
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] *