Ive used the search function just found one thing I needed more detailed help
I need to a read file of float numbers no more than 100 numbers but can be less than 100 into an array
I have made sample file contain 1 2 3
I have the following code
#include <iostream>
#include <fstream>
using namespace std;
const int Max_Size = 100;
int main()
{
ifstream inFile;
float array[Max_Size];
int i;
string fileName;
cout<<"Enter the name of the input: ";
cin>>fileName;
inFile.open(fileName.c_str());
for(i=0; i<Max_Size; i++)
{
inFile>>array[i];
cout<<array[i];
}
inFile.close();
I also have to keep a counter of all numbers in the file