novu datoteku "B" koju cine samo brojevi iz datoteke "A"
(u datoteci "A" mogu biti i brojevi i slova)
ovo je sta ja znam ali ne znam sto treba dopunit da proradi
Code:
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
char ch;
ifstream fil1("ulazni.txt", ios::in | ios::binary);
ofstream fil2("izlazni.txt", ios::out | ios::binary);
do {
fil1.get(ch);
if(ch="0" or ch="1" or ch="2" or ch="3" or ch="4" or ch="5" or ch="6" or ch="7" or ch="8" or ch="9")
{
fil2.put(ch);
}
} while (!fil1.eof());
fil1.close();
fil2.close();
return 0;
}
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
char ch;
ifstream fil1("ulazni.txt", ios::in | ios::binary);
ofstream fil2("izlazni.txt", ios::out | ios::binary);
do {
fil1.get(ch);
if(ch="0" or ch="1" or ch="2" or ch="3" or ch="4" or ch="5" or ch="6" or ch="7" or ch="8" or ch="9")
{
fil2.put(ch);
}
} while (!fil1.eof());
fil1.close();
fil2.close();
return 0;
}
ako iko moze pomoc bio bi veoma zahvalan treba mi za 2h