Commtech wireless Mercury 8-Line Manuel d'utilisateur Page 104

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 124
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 103
ECE 477 Final Report Spring 2004
Menu Editor (C++)
/* Name: Jon Hopp
Compiler/OS Used: gcc UNIX
ECE 477 Group 5 - Simple Menu Editor
*/
#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <string>
#define CHARMAX 20
#define ITEMMAX 16
#define CATMAX 3
using namespace std;
string openTextFile( string filename ) {
string s1 ="";
// converts the string into a char*
const char* newname = filename.c_str();
// opens the file to the editor
ifstream from( newname );
if ( !from ) {
cout << "Cannot open input file: " << filename << endl;
return ("");
}
char ch;
while ( from.get( ch ) )
s1 += ch;
from.close();
return s1;
} // openTextFile()
void saveTextFile( string text, string filename ) {
// converts the string into a char*
const char* newname = filename.c_str();
//saves file
ofstream from( newname );
if ( !from )
cout<< "Cannot open output file: " << filename << endl;
from << text;
from.close();
return;
F-30
Vue de la page 103
1 2 ... 99 100 101 102 103 104 105 106 107 108 109 ... 123 124

Commentaires sur ces manuels

Pas de commentaire