Can you please help !!
Here, you see that
const int size=25;
Actually, How can i use infinite number like (n).
I used "n" like bellow
int n;
const int size = n;
however it only takes 8 values.
My txt file can contained different value(n) evrytime, so, i dont want to keep the const int size fixed. please help me.
If I keep const int value, i can't use for more/less number. To da this always i have to change const int size value.
the software given bellow.
#include<iostream>
#include<fstream>
#include<string>
#include<cstdlib>
#include<cmath>
#include<iomanip>
#include <windows.h>
using namespace std;
//void calculateAverage();
//int calculateGrade();
//void updateFrequency();
int main()
{
const int size=25;
int debug=size;
double test1[size], test2[size];
ifstream infile;
for(int i=0;i<size;i++)
{
test1[i]=0;
test2[i]=0;
}
cout<<"Reading from file ''input.txt''..."<<endl;
infile.open("input.txt");
while(size==debug)
{
for(int i=0;i<size;i++)
{
infile>>test1[i];
infile>>test2[i];
}
debug--;
}
for(int i=0;i<size;i++)
{
cout<<test1[i]<<" "<<test2[i]<<" "<<endl;
}
infile.close();
system("pause");
return 0;
}