Sorell Stratège
Nombre de messages : 521 Localisation : Quel part où le sang coule. Date d'inscription : 01/05/2008
Feuille de personnage Surnom dans la team: Sénéchal Noir Victoire/défaite: (0/0)
| Sujet: TP3 Exercice 1 - Flux standard cin considéré comme un fichier Lun 17 Déc - 12:09 | |
| - Code:
-
/** * * @file Flux_cin.cxx * * @authors M. Laporte, D. Mathieu * * @date 18/11/2011 * * @version V1.0 * * @brief Flux standard d'entree vu comme un fichier * **/
#include <iostream> #include <string>
using namespace std;
namespace { void Flux_cin (void) { string Str;
cout << "Tapez des lignes suivies de <enter> : \n" "Tapez le caractere \"fin-de-fichier\" pour terminer " "la lecture\n\n";
getline (cin, Str); for ( ;! cin.eof (); ) { cout << Str << '\n'; getline (cin, Str); } } // Flux_cin() } // namespace
int main (void) { /* */ Flux_cin (); /* */
return 0;
} // main()
| |
|