Hey guys, i'm having toubles with this piece of code. I can't seem to get the syntax correct, can someone please help.
All I want to code to do is open a text file and display 10 integers.
The next file just includes numbers from 1-10.
Code:#include <iostream> #include <fstream> using namespace std; int main(void) { int num[10]; ifstream a_file ("test.txt"); for(int i = 0; i>10;i++) { a_file>>num[i]; }//end for statement //display all numbers in file for(int z = 0; z > 10; z++) { cout<<num[z]<<"\n"<<endl; }//end for loop cin.get(); //hold screen return 0; }//end main