Moderatori: aurelio37, Anthony47, axelrox
con la libreria standard sono costretto ad effettuare la copia carattere per carattere
#include <fstream>
using namespace std;
int main()
{
ofstream out("file.out");
ifstream in("file.in");
out<<in.rdbuf();
return 0;
}
#include <iostream>
#include <fstream>
using namespace std;
int main(int argn, char** args)
{
if(argn<3)
{
cerr<<"Usage: "<<args[0]<<" <file to copy> <destination>"<<endl;
cerr<<"Makes a copy of the file under the name specified"<<endl;
return 0;
}
ifstream in(args[1]);
if(!in.good())
{
cerr<<"Cannot open "<<args[1]<<endl;
return -1;
}
ofstream out(args[2]);
if(!out.good())
{
cerr<<"Cannot create output file "<<args[2]<<endl;
return -1;
}
out<<in.rdbuf();
return 0;
}
le strutture dati (stack e liste),
quale linguaggio di programmazione è più adatto ad un princi Autore: terrybella |
Forum: Programmazione Risposte: 1 |
Gestione della programmazione Autore: Alessandro Gagliardo |
Forum: Applicazioni Office Windows Risposte: 2 |
Visitano il forum: Nessuno e 47 ospiti