Ver Mensaje Individual
  #2 (permalink)  
Antiguo 26/11/2012, 09:05
vosk
 
Fecha de Ingreso: agosto-2012
Mensajes: 601
Antigüedad: 11 años, 9 meses
Puntos: 83
Respuesta: ¿Por qué tengo que incluir <cstdio> para usar la constante EOF en C++?

EOF está declarado en stdio, a menos que iostream lleve un include stdio no tendras declarada la macro EOF. Esta es la definicion de EOF:

End-of-File
It is a macro definition of type int that expands into a negative integral constant expression (generally, -1).
It is used as the value returned by several functions in header <stdio> to indicate that the End-of-File has been reached or to signal some other failure conditions.
It is also used as the value to represent an invalid character.

Si de todas formas quieres usar EOF sin incluir stdio puedes crear tu propia macro:

Código:
#ifndef EOF
    #define EOF	 (-1)
#endif
Saludos
vosk