Witam probuje rozwiazac podpunkt a) z 4. , z :
http://pobieranie.dlastudenta.pl/matura/2012/informatyka/pp_a2.pdf
mój kod :
#include<iostream>
#include<fstream>
#include<conio.h>
#include<sstream>
using namespace std;
int main()
{
fstream plik;
ofstream zapis;
string cyfry;
int p ;
plik.open ("e:/cyfry.txt" ,ios::in);
zapis.open ("e:/zapiscyfry.txt",ios::out);
while(! plik.eof())
{
getline(plik,cyfry);
if (cyfry % 2 ==0)
{ p++ }
}
zapis<<p<<endl;
getch();
}
bład w :
if (cyfry % 2 ==0)
{ p++ }
tu tez pytanie czy moge adresowac takie cos do stringa jakby , hm ?