mion.adriano@libero.it Guest
|
Posted: Thu Jan 11, 2007 8:42 pm Post subject: Input Output File |
|
|
Hi, experts:
Would you please tell me, in C++, where I mistake?
if I make to turn on the program function LeggiCostanti() it goes well:
I read gamma_c end e_cu
if I make to turn on the program function ScriviSuFile() it goes well:
I write on the file "ciccio.txt"
but if I make turn on the programm function LeggiCostanti() end after
ScriviSuFile(), I don't modify on the file "ciccio" !!
Why?
#include <iostream>
#include <fstream>
ifstream io;
ofstream tu;
//---------------------------------------------------------------------------
int LeggiCostanti() {
io.open("costanti_ec.txt",ios::in);
if(io.is_open()==false) { }
else {
io>>"\n";
io>>gamma_c;
io>>"\n";
io>>e_cu;
io.close();
}
return(0);
}
//---------------------------------------------------------------------------
int ScriviSuFile() {
tu.open("ciccio.txt",ios::out);
if(tu.is_open()==false) {}
else {
tu<<"\n";
tu<<"\n";
tu<<" TRAVE
---------------------------------------------------------"<<"\n";
tu<<" Metodo di calcolo: Stati Limite;"<<"\n";
}
tu.close();
return(0);
}
//--------------------------------------------------------------------------- |
|