How to use vector instead of double array?
I wrote a cpp code, and I used " double stu[ ][ ]" And I filled that with .csv file with a function using ifstream fileobj(str,ios::in) Then I displayed it. But I don't know how to use vector instead and use ifstream again I would be thankful if someone help. This is my code : #include<iostream> #include<fstream> #include<iomanip> using namespace std; void getdata (char str[100],double stu[243][8]) ; int main() { double stu[243][8]; char str[100]="AP-Data.csv"; getdata(str,stu); for(int j=0;j<243;j++) { for(int i=0;i<8;i++) { cout<<stu[j][i]; cout<<"\t"; } cout<<"\n"; } return 0; } void getdata (char str[100],double stu[243][8]) { double m; char ch; int i,j; ifstream fileobj(str,ios::in); for(j=0;j<243;j++) { stu[j][0]=1; for(i=1;i<8;i++) { fileobj>>m; stu[j][i]=m; fileobj>>ch; } } fileobj.close(); for(j=0;j<243;j++)