Commtech wireless Mercury 8-Line Manuale Utente Pagina 104

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 124
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 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
Vedere la pagina 103
1 2 ... 99 100 101 102 103 104 105 106 107 108 109 ... 123 124

Commenti su questo manuale

Nessun commento