now im getting all zero's...
now im getting all zero's...
Anytime you have an issue post the code.
It's the only way I can help you. Cause I don't know what you actually changed.
Woop?
Code:#include<iostream> #include<fstream> using namespace std; int main() { short number = 0; short evenNumber = 0; ofstream outfile; ifstream infile; outfile.open ("evennumList.txt",ios.app); infile.open ("numberList.txt",ios.in); if (infile.is_open()== false) cout << "Error"<<endl; else while(infile >> number) { infile >> number; if (num%2 == 0) { outfile << evenNumber << endl; } } infile.close(); outfile.close(); return 0;
Last edited by swansea; 04-29-2010 at 05:17 PM.
Need to change evenNumber to just number, since that is the value you are checking for even.
That is why it is always 0, because the value of evenNumber never changes.
Woop?
oh yeah duh
thanks